Skip to content
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

Merged
merged 4 commits into from Feb 20, 2017
Merged

Handle theme assets cache burst (fix #761) #781

merged 4 commits into from Feb 20, 2017

Conversation

noirbizarre
Copy link
Contributor

This PR ensure theme assets have a proper cache burst which can be optionnaly extracted from the package version.

udata/theme.py Outdated
burst = pkg_resources.get_distribution(current.pkg_version).version
else:
burst = current.version
return '?'.join((url, '_={0}'.format(burst)))
Copy link
Member

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it happen?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@noirbizarre noirbizarre merged commit b61d593 into opendatateam:master Feb 20, 2017
@noirbizarre noirbizarre deleted the gh-761-theme-assets-cache-burst branch February 20, 2017 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants