Ability to add Cache-Control metadata
Permalink Browser Info Environment
Can S3 Storage add "Cache-Control" metadata upon uploading a file?
It will improve Google's PageSpeed Insights result
https://developers.google.com/speed/pagespeed/insights/...
Many of our clients started to ask us to improve the PageSpeed Insights score because it has a influence over the Search Result.
One of the major problem using S3 storage is that there is no Cache-Control added for browser cache.
Therefore "Leverage browser caching" error shows up and lower the score.
You can check the test from our corporate site.
https://developers.google.com/speed/pagespeed/insights/?url=https%3A...
We're using S3 Storage + CloudFront to deliver the File Manager's file.
In order to enable Brower Cache, you need to add metadata to each S3 objects.
http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/E...
http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/E...
I've tried and tested to confirm that CloudFront's cache setting doesn't do anything for browser cache. S3 object needs to have cache setting.
I'm wondering if you have any plan adding this.
I think it's important and will benefit many concrete5 users by it.
Thanks.
It will improve Google's PageSpeed Insights result
https://developers.google.com/speed/pagespeed/insights/...
Many of our clients started to ask us to improve the PageSpeed Insights score because it has a influence over the Search Result.
One of the major problem using S3 storage is that there is no Cache-Control added for browser cache.
Therefore "Leverage browser caching" error shows up and lower the score.
You can check the test from our corporate site.
https://developers.google.com/speed/pagespeed/insights/?url=https%3A...
We're using S3 Storage + CloudFront to deliver the File Manager's file.
In order to enable Brower Cache, you need to add metadata to each S3 objects.
http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/E...
http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/E...
I've tried and tested to confirm that CloudFront's cache setting doesn't do anything for browser cache. S3 object needs to have cache setting.
I'm wondering if you have any plan adding this.
I think it's important and will benefit many concrete5 users by it.
Thanks.
Type: | Pre-Sale |
---|---|
Status: | In Progress |
I don't believe that this is currently possible with how storage locations work unfortunately.
Would definitely be something that would be good to add.
Would definitely be something that would be good to add.
would be something along the lines of below, this change would have to be made across several files
https://github.com/concrete5/concrete5/blob/7d67412b8b706a5f0f5878eb...
https://github.com/concrete5/concrete5/blob/7d67412b8b706a5f0f5878eb...
$filesystem->writeStream($cf->prefix($prefix, $sanitizedFilename), $src, [ 'visibility' => AdapterInterface::VISIBILITY_PUBLIC, 'CacheControl' => 'max-age=2000', // this is new ]);
Thanks!
Sorry for the late reply.
We'll give it a shot.
Sorry for the late reply.
We'll give it a shot.
Would definitely be something that would be good to add.