CACHE headers and busting technique in jekyll

is there a way to set cache headers and use cache busting techniques in jekyll?

I’ve seen cache busting techniques that use gulp - and would highly recommend using gulp with jekyll to handle as much as possible as it is much quicker.

It’s simple, but I presume something like this might do the job.

That’s an interesting idea, I use S3 to host so I don’t have control like you do.

Did give me the idea that I could just add a querystring to the css/js files that adds the site.date to it, and that would cache bust I think, but would change every time I build rather than every time I change the css/js.

I like your idea of using a site variable, easy enough to remember to change that when needed which is rare for me at the moment.

The Gulp way that I saw used a data file and some sort of Gulp magic to check the date modified and then change the version number if needed in the data file via Gulp.

When I did this for my service worker (and Minima’s), I used one of the Liquid date functions, so no explicit querystring required. It’s a bit verbose and caching is still my enemy, but it works well enough.

it’s really simple:
just append query string to the asset file with jekyll timestamp.
<script src="../assets/js/main.js?v={{ site.time | date:'%s' }}"></script>