-1

I have a very simple flask script below that is supposed to display a dashboard containing some figures that are independent HTML files.

from flask import Flask, send_from_directory
app = Flask(__name__)

@app.route('/')
def home():

    return send_from_directory('.', 'dashboard.html')

if __name__ == '__main__':
    app.run(debug=True)

The HTML file figure.html displays within the dashboard, but is MASSIVELY outdated. I can open figure.html manually and see that the up-to-date pie chart is different than the one being displayed.

A sample of the HTML from dashboard.html that is supposed to display the figure in figure.html is below:

  <div class="col-sm-4">
    <div class="chart-wrapper">
      <div class="chart-stage">
        <iframe width="100%" height="480px" frameborder="0" scrolling="no" src="static/figure.html"></iframe>
      </div>
      <div class="chart-notes">
        Display Figure #1.
      </div>
    </div>
  </div> 

I suspect that this is caused by a caching issue.

Does anyone know how to make the correct figure.html file display?

Learner
  • 17
  • 2

1 Answers1

0

Try doing a page refresh which ignores cached content doing Ctrl+Shift+F5 if you're using a browser like Google Chrome.

If you never want the page to be cached or to futher control how caching works, you can view this answer here.

jacob
  • 3,645
  • 1
  • 19
  • 27
  • The Ctrl + F5 trick worked! Ideally, I would want to have a programatic solution, and the issue is that even if the cache is cleared for `dashboard.html`, it will not be cleared for `figure.html`, which is what matters. – Learner Jul 06 '17 at 16:59