From d47e0482d4567208a0651b7a0a634908317aeeb4 Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Thu, 29 Nov 2018 12:02:18 +0000 Subject: [PATCH] Tell browsers not to re-fetch static assets MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since we version our asset filenames there’s no need for a browser to ever fetch the same file twice. It should always cache fetch from its own cache. The accepted way to effect this behaviour is using the expires header, which is what this argument to `WhiteNoise` does. --- application.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application.py b/application.py index b8561e2f2..28f9b9cdc 100644 --- a/application.py +++ b/application.py @@ -12,4 +12,4 @@ STATIC_URL = 'static/' app = Flask('app') create_app(app) -app.wsgi_app = WhiteNoise(app.wsgi_app, STATIC_ROOT, STATIC_URL) +app.wsgi_app = WhiteNoise(app.wsgi_app, STATIC_ROOT, STATIC_URL, max_age=WhiteNoise.FOREVER)