Jump to content

Amazon S3 Cloudfront- Accept Headers


Recommended Posts

Posted

Hi,

I've recently set up S3 and Cloudfront which has been a bit of a nightmare getting the CName URL right so objects don't keep disappearing after a few days. The help section here is out of date and missing the Cloudfront aspect. I was referrred to the out of date video in one ticket.

If anyone has any tips on this, they would be appreciated. I have the bucket set up as bucketname/IPS/ and on some of my sites it seems fine, others I have to keep moving everything back back to my main server as all the Gallery images, emoticons etc because things start disappearing after a few days. 

Secondly, GTMetrix is reporting this in respect of my CDN:

Quote

The following publicly cacheable, compressible resources should have a "Vary: Accept-Encoding" header:

I have added Accept-Encoding into the Cloudfront Origin's Header Name field, but no joy.

Little help, please?

Many thanks.

Posted

Thanks Adlago, I'd actually read that earlier this week. I've read through it again and although it's now several years old, it seems Amazon we're against supporting serving gzipped or standard content via  S3, because they were of the belief they were following the intended header specification, and referred it instead to Google/Pagespeed. 

It seems to be more of a Cloudfront issue in terms of forwarding the appropriate header request to S3 and Amazon seem to have done work on this but for some reason it's still not straightforward, even in 2018.

I did find this:

https://forums.modx.com/index.php?action=thread&thread=57012&i=1

and then this technique Lambda@Edge Origin Response trigger workaround

https://serverfault.com/questions/856904/chrome-s3-cloudfront-no-access-control-allow-origin-header-on-initial-request/856948

https://forums.aws.amazon.com/thread.jspa?messageID=796312&#796312

Then some Cloudfront documentation at

https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/header-caching.html

I'll need a few more beers before tackling any of the above!

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...