Mobile app version of vmapp.org
Login or Join
Looi9037786

: Can't change HTTP Vary header from PHP I have a test server running CentOS, and changing the Vary header there through PHP via: header('Vary: Accept'); works as expected (it's added to the

@Looi9037786

Posted in: #Apache #Php #Ubuntu

I have a test server running CentOS, and changing the Vary header there through PHP via:

header('Vary: Accept');


works as expected (it's added to the Accept-Encoding value that Apache already adds by itself). On the Ubuntu 10 LTS production server it does not. I tried to search the web for answers, but couldn't find any. Even setting:

header('Vary: Accept',true); // forces the header to be replaced


won't change the Vary header. Any help would be appreciated.

The server is running Apache/2.2.14 (Ubuntu) and PHP/5.3.2-1ubuntu4.26.

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Looi9037786

1 Comments

Sorted by latest first Latest Oldest Best

 

@Margaret670

Check if you have the environment force-no-vary set to TRUE in your configuration, or simply try to set it to FALSE in your virtual host configuration. More details about this and how you should proceed, you can fine here: Environment Variables in Apache.

Also, there are modules that may override this header when the response is served to the client - for example, mod_deflate, but as you mentioned, you don't get this header back at all so my best guess remains the force-no-vary environment setting.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme