-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle theme assets cache burst (fix #761) #781
Handle theme assets cache burst (fix #761) #781
Conversation
udata/theme.py
Outdated
burst = pkg_resources.get_distribution(current.pkg_version).version | ||
else: | ||
burst = current.version | ||
return '?'.join((url, '_={0}'.format(burst))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not '{url}?_={burst}'.format(url=url, burst=burst)
?
def theme_static_with_version(ctx, filename, external=False): | ||
'''Override the default theme static to add cache burst''' | ||
url = global_theme_static(ctx, filename, external=external) | ||
if url.endswith('/'): # this is a directory, no need for cache burst |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it happen?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR ensure theme assets have a proper cache burst which can be optionnaly extracted from the package version.