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.

Type: Pre-Sale
Status: In Progress
katz515
View Replies:
Mnkras replied on at Permalink Reply
Mnkras
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.
Mnkras replied on at Permalink Reply
Mnkras
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.
Mnkras replied on at Permalink Reply
Mnkras
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...

$filesystem->writeStream($cf->prefix($prefix, $sanitizedFilename), $src, [
    'visibility' => AdapterInterface::VISIBILITY_PUBLIC,
    'CacheControl' => 'max-age=2000', // this is new
]);
katz515 replied on at Permalink Reply
katz515
Thanks!
Sorry for the late reply.
We'll give it a shot.

concrete5 Environment Information

All

Browser User-Agent String

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You may not request a refund that is not currently owned by you.