Newbie : Static content caching

Anup Shukla anup at iamcool.net
Mon Jun 11 11:35:34 CEST 2007


Hi Dag-Erling Smørgrav,

Thank you for your response.
It was the cookies.
Forcing varnish to cache requests even if cookies are present does the 
trick.

Thank you again.

Dag-Erling Smørgrav wrote:
> Anup Shukla <anup at iamcool.net> writes:
>> If i request, say for example, a static jpeg, i assume that the first
>> request will be served by the webserver via varnish, and all later
>> requests would be served by varnish, without asking for it from the
>> webserver, that is till the object exceeds its lifetime in the cache.
>>
>> What i observe is this: the request for the jpeg is sent to the
>> webserver everytime, the webserver send the entire content to varnish,
>> and varnish sends a 304 Not Modified to the client browser.
> 
> Most likely, the backend does not set an expiry time on the requested
> image, so Varnish uses the default TTL (normally 120s).
> 
> Another possibility is that your site uses cookies; by default, Varnish
> will not serve requests that come with a cookie from its cache.
> 
> I can provide a more detailed (and correct) explanation if you send me a
> raw varnish log off-list.
> 
> DES




More information about the varnish-misc mailing list