Search squid archive

Re: Documentation for non-Sys Admins

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

 



On 22/01/11 12:52, Andy Nagai wrote:
I noticed that all the documentation on this site is aimed towards linux
system admins that want to setup squid.

We have a remote managed server that had squid installed by some admin.

As a developer I need to know how to control individual page caching. I
heard from somebody to add a expire meta tag to refresh the cache.

NP: meta tags in web pages do nothing outside the web browser. They would have been talking about an HTTP protocol Expires: header.


Two things I need to do:

1) prevent caching for certain pages

  Date: $now
  Expires: $now
  Cache-Control: no-store

NOTE: with $now being the *GMT* timezoned date the page was generated. Make sure the date format matches the slightly old format required by HTTP. Use of newer or UTC formats will fail.

2) set the cache refresh rate for the rest of the pages. Would like to
refresh pages every 15 minutes.

15 minutes from the page last generation time?
  Date: $now
  Last-Modified: $now
  Cache-Control: max-age=6300
  ETag: $(md5 of the object)

Or every 15 minutes at an exact time?
  Date: $now
  Expires: ($now + 15 minutes)
  Last-Modified: $now
  ETag: $(md5 of the object)

NP: there are some validation tests which you will benefit from handling correctly. If-Modified-Since and If-None-Match testing against the ETag to see if the full object needs updating or just the headers.

see below for some reading before you get into the tricky bits like that.


How is this done?

Pointing me to the right doc would be helpful.

Andy


Mark Nottingham has written some great documentation for webmasters and others about caching and how to work it to advantage. These cover a lot of small twists and powerful controls you could do beyond my answers above.

  http://www.mnot.net/cache_docs/

He has a blog with more specific help and other papers around which contain alternative write ups of the topic for various viewpoints and use-cases.

Amos
--
Please be using
  Current Stable Squid 2.7.STABLE9 or 3.1.10
  Beta testers wanted for 3.2.0.4


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

  Powered by Linux