Allow static assets to be cached if not in debug mode (#5684)

This commit is contained in:
Jesse Hills 2023-11-07 12:38:38 +13:00 committed by GitHub
parent fce59819f5
commit 43b36ac3c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1328,9 +1328,11 @@ def make_app(debug=get_bool_env(ENV_DEV)):
if "favicon.ico" in path:
self.set_header("Cache-Control", "max-age=84600, public")
else:
self.set_header(
"Cache-Control", "no-store, no-cache, must-revalidate, max-age=0"
)
if debug:
self.set_header(
"Cache-Control",
"no-store, no-cache, must-revalidate, max-age=0",
)
app_settings = {
"debug": debug,