I have JS and CSS files that are submitted through Amazon Cloudfront. So far I have used my own server running Varnish, and when I updated any JS or CSS file, or I had to do this to use this new version, I had to increase the counter by the URL parameter in the request for this file.
So the url of the included file will go from ... /file.css? r = 1 to ... /file.css? r = 2, and Larnis thinks of it as a new file, ask him to cache it and serve it from the cache from this point.
In Cloudfront, I understand that it doesn’t work like that, it still serves the old cached file (and I always get a “hit from Cloudfront” in the HTTP response).
Any idea if I can change Cloudfront's behavior for this?
Anything else I can do, does this mean that you change the file name every time I update the file? I also do not want to use cache invalidation through the Cloudfront API. I think there is too much work for what I'm trying to do here, and there are a small number of (free) requests per month that I can do.
source share