On Thu, Nov 18, 2010 at 05:38:24PM +0100, Frederik Schumacher wrote: > I'm running a Pressflow site on a LAMP with Apache on port 8080 and > Varnish on port 80. My problem is, that the very first request from > any client is always a miss, this even happens on the same machine - > using for example Firefox for the first request (miss), then curl -I > (miss), then Firefox (hit), then curl -I (hit). Every request after > that is a cache hit. Let's say I request "localhost/foo" using Firefox > and it's a miss (and then gets cached), shouldn't "curl -I > http://localhost/foo" right after that be a hit? Is this expected > behavior, or a mis-configuration?
The objects are most likely being cached independently. The most likely suspect is the headers you Vary on. For pressflow, I believe that will be Cookie and Accept-Encoding by default. If those are not normalized in Varnish you will cache one object for each variation (hence Vary:) of the client-provided Accept-Encoding and Cookie headers. Since pressflow doesn't send cookies for anonymous users, that only really leaves accept-encoding - which is the most common header you have to normalize anyway. Take a look at the example on the wiki [1] for more discussion, and look for a Vary header in the response from your web server. [1] http://www.varnish-cache.org/trac/wiki/VCLExampleNormalizeAcceptEncoding -- Kristian Lyngstøl Product Specialist, Varnish Software Training and Commercial services: http://www.varnish-software.com
signature.asc
Description: Digital signature
_______________________________________________ varnish-misc mailing list [email protected] http://lists.varnish-cache.org/mailman/listinfo/varnish-misc
