ExpiresByType resultados de “acesso mais 1 mês” em 1 ano expira cabeçalho

3

Implementei prazo de validade com a seguinte configuração

<IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType image/jpg "access plus 1 year"
    ExpiresByType image/jpeg "access plus 1 year"
    ExpiresByType image/gif "access plus 1 year"
    ExpiresByType image/png "access plus 1 year"
    ExpiresByType text/css "access plus 1 month"
    ExpiresByType application/pdf "access plus 1 month"
    ExpiresByType application/x-javascript "access plus 1 month"
    ExpiresByType text/javascript "access plus 1 month"
    ExpiresByType application/x-shockwave-flash "access plus 1 month"
    ExpiresByType image/x-icon "access plus 1 year"
    ExpiresDefault "access plus 2 days"
</IfModule>

com a2dismod expira, como esperado eu não tenho cabeçalho Expires:

    wget --server-response --no-check-certificate https://sandbox.trinityp3.com/wp-includes/js/jquery/jquery.js?ver=1.12.4
--2018-10-17 07:57:09--  https://sandbox.trinityp3.com/wp-includes/js/jquery/jquery.js?ver=1.12.4
Resolving sandbox.trinityp3.com (sandbox.trinityp3.com)... 52.77.97.226
Connecting to sandbox.trinityp3.com (sandbox.trinityp3.com)|52.77.97.226|:443... connected.
WARNING: cannot verify sandbox.trinityp3.com's certificate, issued by ‘[email protected],CN=sandbox.trinityp3.com,O=Internet Widgits Pty Ltd,ST=Some-State,C=AU’:
  Self-signed certificate encountered.
HTTP request sent, awaiting response... 
  HTTP/1.1 200 OK
  Date: Tue, 16 Oct 2018 18:57:10 GMT
  Server: Apache/2.4.10 (Ubuntu)
  Last-Modified: Tue, 06 Sep 2016 02:32:13 GMT
  Accept-Ranges: bytes
  Content-Length: 97184
  Vary: Accept-Encoding
  Access-Control-Allow-Origin: *
  Referrer-Policy: 
  Cache-Control: max-age=604800, public
  Keep-Alive: timeout=5, max=100
  Connection: Keep-Alive
  Content-Type: application/x-javascript

com a2enmod expira no entanto recebo uma resposta de expiração de 1 ano

  wget --server-response --no-check-certificate https://sandbox.trinityp3.com/wp-includes/js/jquery/jquery.js?ver=1.12.4
--2018-10-17 08:01:26--  https://sandbox.trinityp3.com/wp-includes/js/jquery/jquery.js?ver=1.12.4
Resolving sandbox.trinityp3.com (sandbox.trinityp3.com)... 52.77.97.226
Connecting to sandbox.trinityp3.com (sandbox.trinityp3.com)|52.77.97.226|:443... connected.
WARNING: cannot verify sandbox.trinityp3.com's certificate, issued by ‘[email protected],CN=sandbox.trinityp3.com,O=Internet Widgits Pty Ltd,ST=Some-State,C=AU’:
  Self-signed certificate encountered.
HTTP request sent, awaiting response... 
  HTTP/1.1 200 OK
  Date: Tue, 16 Oct 2018 19:01:27 GMT
  Server: Apache/2.4.10 (Ubuntu)
  Last-Modified: Tue, 06 Sep 2016 02:32:13 GMT
  Accept-Ranges: bytes
  Content-Length: 97184
  Vary: Accept-Encoding
  Cache-Control: max-age=604800, public
  Expires: Wed, 16 Oct 2019 19:01:27 GMT
  Access-Control-Allow-Origin: *
  Referrer-Policy: 
  Keep-Alive: timeout=5, max=100
  Connection: Keep-Alive
  Content-Type: application/x-javascript

Eu também executei o grep para encontrar qualquer outra declaração de expiração, mas não há nenhuma.

Depois de adicionar o aplicativo ExpiresByType / x-javascript, o problema ainda persiste. Poderia haver um conflito com o deflate?

ubuntu@sandbox:/etc/apache2$ grep -r application/x-javascript *
mods-available/deflate.conf:        AddOutputFilterByType DEFLATE     application/x-javascript application/javascript application/ecmascript
sites-available/710-tp3-au-www-sandbox.conf:    ExpiresByType     application/x-javascript "access plus 1 month"
sites-available/710-tp3-au-www-sandbox.conf:    ExpiresByType     application/x-javascript "access plus 1 month"
    
por jdog 16.10.2018 / 21:03

1 resposta

2

Você não tem a regra ExpiresByType para o arquivo application/x-javascript Content-Type your .js que está sendo exibido.

    
por 16.10.2018 / 21:12