Make sure to always return the same cache busting string on prod, so that reloads of the page can still use the same cached resources
This commit is contained in:
parent
af32b53a4e
commit
b12d63ce9a
1 changed files with 3 additions and 1 deletions
|
@ -138,6 +138,8 @@ def list_files(path, extension):
|
||||||
filepath = 'static/' + path
|
filepath = 'static/' + path
|
||||||
return [join_path(dp, f) for dp, dn, files in os.walk(filepath) for f in files if matches(f)]
|
return [join_path(dp, f) for dp, dn, files in os.walk(filepath) for f in files if matches(f)]
|
||||||
|
|
||||||
|
SAVED_CACHE_STRING = random_string()
|
||||||
|
|
||||||
def render_page_template(name, **kwargs):
|
def render_page_template(name, **kwargs):
|
||||||
if app.config.get('DEBUGGING', False):
|
if app.config.get('DEBUGGING', False):
|
||||||
# If DEBUGGING is enabled, then we load the full set of individual JS and CSS files
|
# If DEBUGGING is enabled, then we load the full set of individual JS and CSS files
|
||||||
|
@ -156,7 +158,7 @@ def render_page_template(name, **kwargs):
|
||||||
main_styles = ['dist/quay-frontend.css']
|
main_styles = ['dist/quay-frontend.css']
|
||||||
library_scripts = []
|
library_scripts = []
|
||||||
main_scripts = ['dist/quay-frontend.min.js']
|
main_scripts = ['dist/quay-frontend.min.js']
|
||||||
cache_buster = random_string()
|
cache_buster = SAVED_CACHE_STRING
|
||||||
|
|
||||||
external_styles = get_external_css(local=not app.config.get('USE_CDN', True))
|
external_styles = get_external_css(local=not app.config.get('USE_CDN', True))
|
||||||
external_scripts = get_external_javascript(local=not app.config.get('USE_CDN', True))
|
external_scripts = get_external_javascript(local=not app.config.get('USE_CDN', True))
|
||||||
|
|
Reference in a new issue