1

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.

1 Answer 1

1

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.

2
  • 2
    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
    Commented Mar 27, 2012 at 16:20
  • Be sure to accept my answer if it helped ...
    – EAMann
    Commented Mar 27, 2012 at 20:38

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