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

bustOnly Option #62

Closed
58bits opened this issue Aug 9, 2014 · 1 comment
Closed

bustOnly Option #62

58bits opened this issue Aug 9, 2014 · 1 comment

Comments

@58bits
Copy link

58bits commented Aug 9, 2014

Not sure if you'd be interested in this - but I've just implemented a 'bustOnly' option - which updates the reference URLs with the hash of the assets, but does NOT rename the actual files. This works in conjunction with the following server rewrite rules:

#Apache
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteRule ^(.+)\.([0-9a-f]{16})\.(js|css|png|jpg|gif)$ $1.$3 [L]

#Nginx
rewrite '^/(.+)\.([0-9a-f]{16})\.(js|css|png|jpg|gif)$' /$1.$3 last;

The updated repo is here... https://github.com/58bits/grunt-cache-bust

I could submit a pull request if you like the idea.

@benhoIIand
Copy link
Owner

There is already an option to turn the file renaming off - https://github.com/hollandben/grunt-cache-bust/blob/master/tasks/cachebust.js#L32. If you set that to false, it will add the hash as a query string parameter. Is that not what you're looking for?

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