I have a bucket on Amazon S3 where I save files that sometimes change, but I want to use the maximum caching on them, so I want to use URL fingerprints to invalidate the cache.
I use the “last modified” date of the files for the fingerprint, and the html page requesting the S3 files always knows every fingerprint of the file.
Now I understand that I can use the fingerprint in the query string, for example:
http:
but the query string is not always sufficient for some proxy servers or older browsers to invalidate the cache, and some proxy servers and browsers do not even cache it if it contains the query string. This is why I want to save the fingerprint in the actual URL, for example, one of them:
http:
http:
http:
etc
Any of these URLs are perfect for requesting myFile.jpg, but I want all this to be reassigned to a file http://aws.amazon.com/bucket/myFile.jpg. That is, I want the URL to change, so the browser will consider it to be a new file and get a new file that it will cache for a year. When I download a new version of this file, the fingerprint is automatically updated.
Now here is my question: is there a way to rewrite the URL so that the request for the URL, for example http://aws.amazon.com/bucket/myFile-xxxxxx.jpg, serve the file http://aws.amazon.com/bucket/myFile.jpgon Amazon S3? Or are there any other workarounds that will still store the file in the cache? Thanks =)
source
share