Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

126
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!