Problemas com compactação Gzip no Amazon CloudFront

3

Eu tinha uma distribuição do CloudFront configurada com o S3 como origem.

Eu habilitei "Compactar objetos automaticamente", de acordo com o guia da Amazon. Aguardou o status da distribuição exibir "online" e invalidou todos os arquivos.

Meus cabeçalhos de resposta são:

Age:5
Connection:keep-alive
Content-Length:232359
Content-Type:application/javascript
Date:Sat, 03 Mar 2018 15:39:10 GMT
Last-Modified:Sat, 03 Mar 2018 15:37:32 GMT
Server:AmazonS3
Vary:Accept-Encoding
Via:1.1 4dbdc57755819d1a0ec1defc2630d677.cloudfront.net (CloudFront)
X-Amz-Cf-Id:6eHPWzOXv2J6kIvzuieoI9chtPBBvEvJFH9fb3yMwHvvcMZ4xsigCA==
X-Cache:Hit from cloudfront

Solicitar cabeçalhos:

Accept:*/*
Accept-Encoding:gzip, deflate, br
Accept-Language:en-GB,en;q=0.9,en-US;q=0.8,pl;q=0.7,zh;q=0.6
Cache-Control:no-cache
Connection:keep-alive
Host:d2h5tcpn9r8alm.cloudfront.net
Pragma:no-cache
Referer:https://noru.co.uk/
User-Agent:Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.186 Safari/537.36

Tem um "Content-length" e suporta "Content-Type", o que me falta? Eu estou ficando louco aqui ...

Desde então, criei um novo bucket s3 e uma nova distribuição seguindo as etapas descritas acima, mas escolhendo um local de bucket diferente (caso isso esteja afetando de alguma forma), Aqui estão as configurações gerais de distribuição:

Delivery Method Web
Cookie Logging  Off
Distribution Status Deployed
Comment -
Price Class Use All Edge Locations (Best Performance)
AWS WAF Web ACL -
State   Enabled
Alternate Domain Names (CNAMEs) -
SSL Certificate Default CloudFront Certificate (*.cloudfront.net)
Domain Name d189ud9v76clu1.cloudfront.net
Custom SSL Client Support   -
Security Policy TLSv1
Supported HTTP Versions HTTP/2, HTTP/1.1, HTTP/1.0
IPv6    Enabled
Default Root Object -
Last Modified   2018-03-03 15:46 UTC
Log Bucket

e comportamentos: comportamentos de distribuição

Ainda não consigo que o gzip funcione aqui é o novo arquivo: link

    
por Lukigi 03.03.2018 / 17:29

2 respostas

0

Depois disso, paguei pelo suporte técnico da AWS para resolver esse problema, eis a resposta deles:

I do understand as it can be frustrating, unable to view changes made to your configuration using Developer Tools.

From the documentation that is online I do confirm that it can be a little confusing which I will do a feedback request to make some changes to the documentation, in your case it's more performance changes, if you look at the bottom of Chrome browser, Network option under Developer tools you will see how your pages performance was impacted due to the gzip compression.

To view the configuration through the browser another option the same as you would get in the "curl" command output, by viewing the Response Headers in Developer Tools from any browser.

This can be found if you go the Developer Tools -> Select Network: * As you saw all the links to your resources , click on the top link domain name "noru.co.uk". * This will open your Headers which will give the same output as the curl command did example:

Accept-Ranges: bytes

Alt-Svc: quic=":443"; ma=2592000; v="35,37,38,39"

Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0

Content-Encoding: gzip

Content-Length: 3152

Content-Type: text/html; charset=utf-8

Date: Tue, 20 Mar 2018 06:37:04 GMT

Etag: "7073226-1521527798;gz"

Expires: Thu, 19 Nov 1981 08:52:00 GMT

Pragma: no-cache

Server: LiteSpeed

Vary: Accept-Encoding

X-Firefox-Spdy: h2

charset: utf-8

x-litespeed-cache: hit,private

x-powered-by: Craft CMS

This will give you most of the information of your configuration to your web pages of that domain.

I hope this helped, if you have any other concerns, please don't hesitate to contact us as I would gladly further assist.

    
por 25.10.2018 / 13:10
2

O seu pedido contém o cabeçalho Accept-Encoding: gzip necessário?

Seus cabeçalhos se parecem com a saída curl, que não envia esse cabeçalho por padrão.

Você pode testar a codificação gzip com curl via: curl -H "Accept-Encoding: gzip" https://example.com/asset.js"

    
por 03.03.2018 / 18:43