http - How to setup cache header for cloudfront so Google Pagespeed recognizes it? -


i'm serving static content s3 , through cloudfront. however, google pagespeed flags cache-header not specified go cloudfront settings , changed it.

enter image description here

once distribution deployed. google pagespeed still doesn't recognize that.

i add cache-control object on s3. when hit object directly s3 can see response header when hit using cloudfront url don't see cache-control header.

here's response get

accept-ranges:bytes age:641 connection:keep-alive content-length:44715 content-type:image/png date:fri, 17 jul 2015 18:39:50 gmt etag:"e0b19573b90781f60f8865705c80f11d" last-modified:fri, 17 jul 2015 17:50:27 gmt server:amazons3 via:1.1 (cloudfront) x-amz-cf-id: x-cache:hit cloudfront 

based on age of http response headers provided, looks object has been in cache 641 seconds. maybe case added cache-control headers s3 after object has been cached. recommend invalidating object , making request again. should notice x-cache header miss, meaning cloudfront went origin.

once distribution deployed. google pagespeed still doesn't recognize that.

cloudfront not modify cache-control headers. values impact how long cloudfront caches objects.


Comments