Re: [squid-users] Cache settings per User Agent?

From: Henrik Nordstrom <henrik_at_henriknordstrom.net>
Date: Tue, 07 Oct 2008 20:24:45 +0200

On tis, 2008-10-07 at 23:02 +0800, howard chen wrote:

> On Tue, Oct 7, 2008 at 8:11 PM, Henrik Nordstrom
> <henrik_at_henriknordstrom.net> wrote:
> > Best done by the origin server using the Vary header and Cache-Control:
> > max-age..
> >
>
> It can't, since it will confuse my squid to cache the page for normal
> user.

No, it won't.

Your server when seeing a request from one of the spiders responds with

Vary: user-agent
Cache-Control: max-age=72000

Or whatever age you want for the search content..

If you can throw an ETag or Last-Modified in there as well, and have the
server react reasonably on If-None-Match / If-Modified-Since conditional
requests then even better but that's a bonus.

If the request is NOT from one of these spiders you respond with
personalized content and headers looking as:

Vary: user-agent
Cache-Control: private

Regards
Henrik

Received on Tue Oct 07 2008 - 18:24:54 MDT

This archive was generated by hypermail 2.2.0 : Wed Oct 08 2008 - 12:00:02 MDT