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

Update references in .css and .js files to other files so they refer to the cache-busting filenames #26

Open
foarsitter opened this issue Oct 28, 2021 · 3 comments

Comments

@foarsitter
Copy link

When an image is referenced from a css file it references to the unhashed version of the file. This could lead to issues when the referenced file is updated.

Django has this behavior implemented so we can use there patterns for replacing references in .css and .js files.

If this feature is wanted I will provide a pull request.

@nickjj
Copy link
Owner

nickjj commented Oct 28, 2021

Hi,

I would like to support the idea of referencing the hashed files in CSS / JS files. Does the Django approach end up doing a find / replace in the final bundled CSS / JS files afterwards instead of depending on a dynamic lookup like the Jinja template approach is doing with a custom helper?

@foarsitter
Copy link
Author

My approach would be a find and replace since its a straightforward solution. Also, I'm not aware of the other approach you refer to.

@nickjj
Copy link
Owner

nickjj commented Oct 29, 2021

The other approach is how this extension works for Jinja templates. A new template function exists that's aware of the cache manifest file and does the lookup for the human readable file name to the hashed file name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants