Htaccess vary header with inconsistency issue

608 Views Asked by At

can anyone point out what is wrong with my htaccess coding?

I am getting errors: This response is negotiated, but doesn't have an appropriate Vary header. The resource doesn't send Vary consistently.

## add vary header
<IfModule mod_headers.c>
  <FilesMatch ".(js|css|gz|xml)$">
    Header append Vary: Accept-Encoding
  </FilesMatch>
</IfModule>

## Add Expire Headers
<IfModule mod_expires.c>
    ExpiresActive On
    ExpiresDefault "access plus 1 year"
</IfModule>

# 1 month catching
<filesMatch "\.(css|js|jpg|jpeg|png|txt|html)$">
Header set Cache-Control "max-age=2678400, must-revalidate"
Header set Last-Modified "Mon, 16 Oct 2012 00:00:00 GMT"
</filesMatch>
1

There are 1 best solutions below

0
On

Try to remove this one:

{<IfModule mod_headers.c>
  <FilesMatch ".(js|css|gz|xml)$">
    **Header append Vary: Accept-Encoding**
  </FilesMatch>
</IfModule>}

It's probably set elsewhere.

I hope this helps you.