AlexZd
AlexZd

Reputation: 2152

Vary Accept-Encoding header don't works

I added next lines in .htaccess, which I found here How to specify vary accept encoding header in htaccess

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

but it isn't works, also I checked phpinfo (Loaded Modules: mod_headers...). I use Page Speed plugin and I can't see this header in my css file. Why it isn't works?

Upvotes: 2

Views: 7185

Answers (3)

Nickname
Nickname

Reputation: 109

If the other examples doesn't work, try this:

<IfModule mod_headers.c>
    Header set Vary "Accept-Encoding"
</IfModule>

Upvotes: 0

SureshKumaran
SureshKumaran

Reputation: 331

Add this one in .htaccess file ,it will work

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

Upvotes: 0

Demian
Demian

Reputation: 51

Maybe you want use this:

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

with semicolon

Upvotes: 5

Related Questions