我想在我的頁面上加載壓縮的JavaScript和CSS文件。我的文件位於amazon s3服務器中,並且已將Cloudfront分發配置爲自動壓縮對象。即使在設置Cloudfront Distribution之後,我仍然可以獲取頁面上的未壓縮文件,而不是Cloudfront應該加載的壓縮文件。GZIP不在亞馬遜Cloudfront工作
文件在我的亞馬遜S3服務器
https://s3.us-east-2.amazonaws.com/02242017-bucket1/animate.css
https://s3.us-east-2.amazonaws.com/02242017-bucket1/jssor.js
我的請求頭讀取
Accept:*/*
Accept-Encoding:gzip, deflate, sdch, br
Accept-Language:en-US,en;q=0.8
Connection:keep-alive
Host:s3.us-east-2.amazonaws.com
Referer:http://test.sitepm.com/simplewebcontent/710/1/peterspage1
User-Agent:Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36
我的響應頭爲
Accept-Ranges:bytes
Content-Length:58701
Content-Type:application/javascript
Date:Tue, 28 Feb 2017 10:30:41 GMT
ETag:"be74d5befb57a55bcf71d5af775f8dfb"
Last-Modified:Fri, 24 Feb 2017 05:06:32 GMT
Server:AmazonS3
x-amz-id-2:ioAxulBZpyxcqCAdvQ47uCuA2zwvh9wrUXA6yyPdL0dt9suwZWSHc8E0hrxte+cBd8kpQt4IYEI=
x-amz-request-id:1FA844B6044B1E2A
誰能告訴我什麼,我在這裏失蹤......
這是你在說什麼「域名\t d3djkdfiadimdg.cloudfront.net」。如果是這樣,我的文件將如何成爲? – Stuborg
'https:// s3.us-east-2.amazonaws.com/02242017-bucket1/jssor.js'會變成'https:// d3djkdfiadimdg.cloudfront.net/jssor.js'。 –
您建議的網址給了我一個錯誤頁面 – Stuborg