We are developing a large website and all of our images and resources are on Amazon S3. We also use Cloudfront to distribute our content globally. We want the clients web browser to cache our files because when we change them, we will also change the URL (Cloudfront does not reflect the change within 24 hours elsewhere).
We currently use ETags, but this is not optimal, because the Client still has to fulfill the request to check if the resource has changed.
One solution would be the Expires header, but we did not find a way to set it relative to the current date, as it is possible in the Apache configuration for S3, and we cannot regularly update all the content, because this is largely. Therefore, we need a configuration option that sets the Expires header to Date relative to the current date for all content.
Another solution is to set Cache-Control: max-age to a specific value. It works? Is this accepted by major browsers? Will I be able to destroy some caching algorithms with this? Why does YSlow recommend setting the Expires header, but not Cache-Control: max-age?
Any other recommendations? We compress CSS and JS using Sprites, wherever plausible, setting the Expires and ETags headers where possible, and soon compress our images using the Yahoo compression tool and gzipping Output.
Paul weber
source share