Closed theandyyates closed 10 years ago
This issue seems to be a duplication of #7.
Cache busting is meant to be part of your build system. It is not intended to change your original source. Doing so would pollute your git repo with unnecessary changes and when you work with a team this will for sure cause conflicts among different members in the team.
The workflow would be:
Though it might be possible to get replacement to work with an regex, which will update the hashed reference. You should try it out to get this to work if you are really aiming for this.
Thanks for the response Paul. No team, but I'll use as you advise in any case. All the best.
Hi there,
I've been applying cache-busting in my grunt workflow for my styles.css file. Running the task first time round works perfectly, appending the hash to both the css file and the html file path.
However, when re-running the task after updating the css file, the file hash is appended, and the old one is cleaned up. However, the html path keeps the original hash. I suspect this is due to the search string in the 'replacement' no longer generating a hit due to the presence of the hash?
'cache-busting': { css: { replace: ['inc/head.php'], replacement: '/css/styles.min.css', //no hash in search string, so no update in html? file: 'css/styles.min.css', cleanup: true } },
Is there a clean work around?