Search squid archive

bypassing cache under certain circumstances

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

For the setup I'm about to discuss, I used to use varnish, but due to
stability issues decided to use squid instead. It's a rather usual
reverse-proxy setup with squid 3.0. However, I do have one issue that
could have been solved easily with varnish, but I can't find a good
solution for squid. Thing is:

Pages are cached. I want them to be cached, but.. there are some users
that come with a Cookie NOCACHE. I want those users to get fresh
pages, but at the same time, I want that other users would gather the
cached pages as usually. I tried the following:

acl nocache_cookie req_header Cookie NOCACHE
cache deny nocache_cookie

However, as described in
http://www.squid-cache.org/Versions/v3/3.0/cfgman/cache.html - "use
this to force certain objects to never be cached" and not only it does
not cache then - but also updates it's cache lists that the object is
not cached. So what I get is:

#1 user comes w/o NOCACHE -- she gets a CACHE_MISS, page from
originserver, and gets it cached
#2 user comes w/o NOCACHE -- she gets a CACHE_HIT i.e. the cached page
#3 user comes w/ NOCACHE -- she gets a CACHE_MISS and fresh page
directly from originserver (page does not get cached)
#4 user comes w/o NOCACHE -- she gets a CACHE_MISS, page from
originserver, and gets it cached

and obviously this is not what I want - I'd rather have page kept in
cache at step #3 (at the same time feeding the page directly from
originserver to user #3).

In varnish I could have achieved that with

sub vcl_recv {
        if (req.http.Cookie ~ "NOCACHE") {
                pass;
        }
}


Appreciate your thoughts!

// Aurimas

[Index of Archives]     [Linux Audio Users]     [Samba]     [Big List of Linux Books]     [Linux USB]     [Yosemite News]

  Powered by Linux