Fork me on GitHub

@dominicm thanks, I'm serving site from s3 though, through cloud front. So I can't really work with the server settings. So I was more thinking of appending a timestamp to the file or something like that.


@vikeri I think s3/cloudfront handles last-modified timestampts by default


But cloudfront is usually configured to cache quite aggressively. E.g. confetti uses Cloudfront invalidation API to remove the files from cloudfront cache so they get loaded from S3.


Timestamps don't help if cloudfront won't even check if the timestamp is changed in s3.


Cloudfront default cache TTL is 24 hours.


@juhoteperi ok! Yeah true. I really like the concept of confetti but I'd like to manage our infrastructure in terraform. So maybe I'll just add a call to the AWS CLI that invalidates the cache.


I’m also slowly moving towards a mindset of handling resource creation with terraform and turning Confetti into a “bootstrapping tool” for a terraform setup and utilities for syncing. (I think sync-bucket and the underlying s3-deploy library are pretty good.)


Haven’t gotten around implementing that yet though 😄


Best approach would be to invalidate html files when they change, and use content addressable uris for JS and other resources. And then update the html to point to new JS file each time.


Currently I use invalidation for all files as I haven't had time to configure content addressable uris for static resources.


It is also possible to configure Cloudfront cache TTL to 0 sec, and then it would ask S3 for each request if the file has changed, but obviously that isn't very optimal


@vikeri Btw. I don't really use confetti much, only the sync-bucket task, I created the s3/cloudfront from aws console and then just configured the keys.


@juhoteperi Ok, yeah I still like to use the cache. I'll look into content addressable uris.