WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've hired incapsula.com performance services for my wordpress blog, and one of their techs is telling me this about the performance of my website:

On important note, yoursite.org returns the Vary caching header on User-Agent. This will reduce caching and acceleration performance dramatically (!!!). Why are you using Vary on User Agent for images? Is it possible to disable it?

As I use W3 Total Cache, I guess this 'Vary on User Agent for images' was activated by this plugin. My question:

How can I deactivate this 'Vary on User Agent for images' from W3TC that this tech is talking about? I tried to find such an option but can't find it inside W3TC menu.

I appreciate any light on this.

Thanks a lot.

share|improve this question

closed as off-topic by gmazzap, Mark Kaplun, ialocin, birgire, Rarst Aug 25 '14 at 16:07

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

I use W3 Total Cache as well, so I double checked on my site to see what headers are being sent ... and images are not sending anything that varies on User Agent.

An example image response header:

HTTP/1.1 200 OK
Server: nginx
Date: Tue, 27 Mar 2012 15:48:18 GMT
Content-Type: image/png
Transfer-Encoding: chunked
Connection: keep-alive
Vary: Accept-Encoding
X-Powered-By: PHP/5.3.8
Last-Modified: Fri, 25 Mar 2011 01:52:43 GMT
ETag: "b5baa1b261894936c4c1da309703fa2a"
Expires: Fri, 29 May 2015 01:34:58 GMT
Content-Encoding: gzip

The Vary header is specifying "accept-encoding," which makes sense. If your browser doesn't support gzip encoding, I would naturally want the server to return a different cached file.

But this shows that this isn't necessarily W3 Total Cache's fault. Unless you've specifically set up a Vary: User-Agent header (i.e. on the Page Cache page where you can cache specific headers), then you've got something else going on here.

share|improve this answer
Fixed! It was not W3TC, just a custom .htaccess rule I set long time ago, removed that and now the headers looks really fine. Thanks a lot for your help dude! – Steven Mar 27 '12 at 16:20
Be sure to accept my answer if it helped ... – EAMann Mar 27 '12 at 20:38

Not the answer you're looking for? Browse other questions tagged or ask your own question.