Caching doubt

Jonathan Leibiusky ionathan at gmail.com
Mon Sep 6 16:40:01 CEST 2010


Hi!
I'm playing with If-None-Match and Cache-Control: max-age   headers and I
have a doubt. Maybe it is more related to HTTP than Varnish, but it worth
asking.

Imagine that I have 3 user-agents, a varnish and my webserver.
When the clients ask the first time for /example, varnish doesn't have
anything cached so he ask the webserver for it. The webserver response has
Cache-Control: max-age=180 and ETag: 123 (for example).
So Varnish will cache the response for 180 seconds as well as the
user-agents.
After 180 seconds, the 3 user-agents will request /example for a conditional
If-None-Match header because they got the ETag. Since it is a conditional
request varnish will ask the webserver and will get a fresh response with
all the caching headers. When the other 2 user-agent make the same
conditional request they will generate another request to the webserver
unless varnish has some mechanism to answer himself.
Is that right? Does varnish has this mechanism?

Thanks!

Jonathan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20100906/b00b1bab/attachment-0003.html>


More information about the varnish-misc mailing list