Welcome to 16892 Developer Community-Open, Learning,Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I have a single png file in my static folder that I update from each run and each time it is updated, it shows up in my webpage. However, no matter how many times I edit the png file, the edited version does not display on my webpage, and some older version does.

I have researched that this is a cache issue, but I cannot figure out how to empty the cache just of one png file.

It's driving me crazy.

Function that saves png file to static folder:

def plot_df(df, x, y, title="", xlabel='Date', ylabel='Tweets per date'):
    plt.figure()
    plt.bar(x, y)
    plt.gca().set(title=title, xlabel=xlabel, ylabel=ylabel)
    plt.savefig('static/timeseries.png') 

Accessing that file in html:

<h2 style="margin-top: 80px; margin-bottom: 20px; text-align: center;"><b>Time Series</b></h2>
<div style="text-align: center;">
    <img src="{{ url_for('static', filename='timeseries.png') }}" alt="" width="1000" height="700" style="border-radius: 20px; margin-bottom: 140px;">
</div>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
325 views
Welcome To Ask or Share your Answers For Others

1 Answer

等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to 16892 Developer Community-Open, Learning and Share
...