Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

137
Visualizações
is disabling ETAG and Last-Modifed a good option .htaccess

I'm using the below code for caching of files in .htaccess

<IfModule mod_headers.c>
    <filesMatch "\.(ico|jpe?g|png|gif|swf)$">
        Header set Cache-Control "public"
    </filesMatch>
    <filesMatch "\.(css|scss)$">
        Header set Cache-Control "public"
    </filesMatch>
    <filesMatch "\.(js)$">
        Header set Cache-Control "private"
    </filesMatch>
    <filesMatch "\.(x?html?|xml)$">
        Header set Cache-Control "private, must-revalidate"
    </filesMatch>
    #Header unset ETag
    #Header unset Last-Modified
</IfModule>

I'm a bit confused if i should comment the #Header unset ETag and #Header unset Last-Modified or not

below is my default.conf file on apache

CacheQuickHandler off                                                                                              
CacheLock on
CacheLockPath /tmp/mod_cache-lock
CacheLockMaxAge 5                                                                                                  
CacheIgnoreHeaders Set-Cookie
<Location />                                                                                                       
CacheEnable disk                                                                                                   
CacheHeader on                                                                                                     
CacheDefaultExpire 600                                                                                             
CacheMaxExpire 86400
CacheLastModifiedFactor 0.5                                                                                        
ExpiresActive on                                                                                                   
ExpiresDefault "access plus 1 week"                                                                                
ExpiresByType image/x-icon "access plus 1 month"                                                                   
ExpiresByType image/jpeg "access plus 1 year"                                                                      
ExpiresByType image/png "access plus 1 month"                                                                      
ExpiresByType text/css "access plus 1 month"                                                                       
ExpiresByType text/javascript "access plus 1 month"
ExpiresByType application/ld+json "acesss plus 1 day"                                                              
# This part sets the expires for the fonts                                                                         
ExpiresByType application/vnd.ms-fontobject "access plus 1 year"
ExpiresByType application/x-font-ttf "access plus 1 year"
ExpiresByType application/x-font-opentype "access plus 1 year"
ExpiresByType application/x-font-woff "access plus 1 year"
ExpiresByType image/svg+xml "access plus 1 year"                                                                   
#Header merge Cache-Control public
FileETag All                                                                                                       
</Location>

Kindly anyone help me with this confusion what should i do to achieve maximum and best compression.

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

Etag and Last-Modified have nothing to do with compression, they are cache'ing options. Which is OK to unset anyway because they conflict with Cache-Control, which is a better cache method. So yes, you may disable it.

If you are looking for compression, look into Apache's mod_deflate, mod_gzip or mod_brotli.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda