4 ms·
same, except i use hugo. it's extremely easy to self host static content now, especially with something like netlify
by gnarcoregrizz 8y ago
same, except i use hugo. it's extremely easy to self host static content now, especially with something like netlify
- nickjj 8y agoI tried Hugo years ago but couldn't get on board because it doesn't treat assets as a first class citizen. For example with Jekyll, all you have to do is pull in Jekyll-Assets and you get perfect md5 asset tagging for cache busting along with typical SCSS / JS processing and other goodies. It takes about 2 minutes to configure a hyper optimized asset pipeline and you never have to think about it again.
- gnarcoregrizz 8y agoBuilding scss/js with hugo hasn't been an issue for me yet - the theme I use shipped with its own build pipeline, as I imagine others do. Fortunately, the theme dev organized it well. I didn't know about the cache busting with jekyll. Right now, I just toss assets into the 'static' dir so I don't think Hugo does anything with them, but I think there are other ways/shortcodes to serve them. Overall, I'm not super happy with hugo, I just latched onto the "it's fast" marketing line because I've had bad experiences with Ruby's performance. As far as my main gripe, the go templating engine seems pretty bad.. Either that, or I don't know how to use it well. I believe templating engines are swappable, however. Overall, my content is so simple (photos + text) that the usability issues don't bug me yet.
- nickjj 8y agoCache 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.