4 ms·
Cache busting would be appending things like the last 8 characters of an asset's MD5 hash to the file name. You end up serving logo-bad253c1.jpg as your asset
by nickjj 8y ago
Cache busting would be appending things like the last 8 characters of an asset's MD5 hash to the file name.
You end up serving logo-bad253c1.jpg as your asset file name, so you can cache it forever with nginx, and if the logo changes, the asset's filename gets changed.
With Jekyll-Assets (a plugin) all of that is taken care of for you under the hood. You just reference {% image logo.jpg %} in your templates and it does the rest when you build your site.
Doing things like converting SCSS to CSS and other optimizations are included too, but the main issue is I don't think Hugo has anything for that cache busting strategy that works in a generic way (adding a querystring is no good because a lot of proxies strip out that data).
- kaushalmodi 8y agoI use this technique for cache busting with Hugo: https://blog.carlmjohnson.net/post/2017/hugo-asset-pipeline/ https://blog.carlmjohnson.net/post/2017/hugo-asset-pipeline/. I am not a web developer, so have translated that flow to a simple Bash script which I run on Netlify. Hugo v0.43 has inbuilt cache busting on the roadmap, and Hugo v0.42 will probably be released in about a week.