Re: [squid-users] Re: cache issues

From: Amos Jeffries <squid3_at_treenet.co.nz>
Date: Mon, 26 Jan 2009 21:03:22 +1300

Maoz wrote:
> Hello Amos,
>
> Thank you for your answer!
> I do not use expire header, my problem is that I only have Cache-Control
> max-age headers on my dynamic pages (no Last-Modified) and I really need
> to cache this pages according to the max-age headers.
>
> what will be the best way to do it?

Squid caches by default for as long as it is permitted.

If the variant identifiers are not present you will get users being
given versions of the page they cannot display, or publicly sending
versions with private information inside.

>
> Set header on apache to the system time environment variable, can it be
> done?
> Or is there a way to overcome this issue with the squid configuration,
> and force the caching even though it have no Last-Modified headers?
> is that other way without changing my application?
>
>
> I tried the following configuring on squid but nothing work for me.
>
> refresh_pattern JHTML 60 75% 360 ignore-reload ignore-no-cache
> ignore-no-store override-lastmod override-expire
> acl JHTML urlpath_regex .*\.jhtml

This ACL will only catch pages with lower-case file endings.
And contains duplicate settings to what squid gets from the headers.

> no_cache deny JHTML

"no_cache" and "cache" mean exactly the same thing.
The above line says "don't ever cache these pages for any reason".
Removing it should be all you need for the pages to cache.

> cache allow JHTML
>
> #Ignore force reload to send reqest to the server
> refresh_pattern . 0 100% 86400 ignore-reload
> refresh_pattern (\.jhtml|\.html) 0 75% 350 ignore-reload ignore-no-store
> override-lastmod

These patterns are around the wrong way.
The top one of these two will match all requests and stop the following
one happening.

I believe the best config you want is just:

   acl JHTML urlpath_regex -i .*\.jhtml
   cache allow JHTML

Amos

-- 
Please be using
   Current Stable Squid 2.7.STABLE5 or 3.0.STABLE12
   Current Beta Squid 3.1.0.4
Received on Mon Jan 26 2009 - 08:03:19 MST

This archive was generated by hypermail 2.2.0 : Tue Jan 27 2009 - 12:00:03 MST