Re: [squid-users] squid and php-sites

From: alp <alpheus@dont-contact.us>
Date: Sat, 15 Feb 2003 14:02:43 +0100

thx again, henrik.
it is becoming clear to me (wish i had your knowledge!).
it is maybe only of philosophical interest: i am wondering if such a request
for test.php would be cached initially. i mean, if a client requests it the
very first time, then refresh_pattern is not used, since it is simply the
first time. so, unless squid knows to not cache it due to missing appropiate
headers, it may be cached (or not???).
then, at the second request, refresh_pattern is used for it.
no expires, no client_max_age, no obj_age>conf_max, no obj_date>obj_lastmod,
then the last step in the refresh algorithm should be used: obj_age <=
conf_min ?
since i have conf_min=0, the object is to be stale.
is this right and did you mean this with your explanation? (i just hate to
not fully understand something - as an apology for my steady asking...)

by the way,
if i have explicit entries for refresh_patterns, but no default rule and one
object misses my rules. will it then be regarded as fresh or stale?

alp

----- Original Message -----
From: "Henrik Nordstrom" <hno@squid-cache.org>
To: "alp" <alpheus@gmx.de>
Cc: <squid-users@squid-cache.org>
Sent: Saturday, February 15, 2003 12:30 PM
Subject: Re: [squid-users] squid and php-sites

> This pattern will not cache such replies as they are fresh for 0 seconds
> and cannot be revalidated, meaning that even if Squid did cache these it
> would never be able to reuse the cached content as it is immediately
> stale and without any validators it cannot ask the origin server if the
> same reply is still up to date on a later request.
>
> To have such replies cached you need to use a refresh pattern with min >
> 60 seconds, telling Squid that even if the reply did not have any
> information regarding to fresshess or expiration time it is OK to cache
> it for the min age in your refresh pattern.
>
> Note: Doing so WILL BREAK certain web sites with dynamic content not
> aware of the existence of shared web caches like Squid, possibly leaking
> private information between different users. In all such cases the error
> is at the origin web server not telling that the information is private,
> but it is extremely likely your cache will be blaimed as it works
> without caches or with most other caches not having such refresh pattern
> rule.
>
> Regards
> Henrik
>
>
>
> alp wrote:
> >
> > hi henrik,
> >
> > 1) refresh_pattern . 0 20% 4320
> > if i understand your note correctly, this is not correct for
php-sites???
> > but it should, since the dot finds any object, doesn't it?
> > nevertheless, i also tried
> > refresh_pattern \.php 0 20% 4320
> > with the same effect (see 2)
> >
> > 2)
> > if i do the request for test.php i see:
> > HTTP/1.0 200 OK
> > Daten: Sat, 15 Feb 2003 08:00:00 GMT
> > Server: Apache/1.3.27 PHP/4.1.2
> > X-Powered-By: PHP/4.1.2
> > Content-Type: text/html
> > X-Cache: MISS from test.de
> > Connection: close
> >
> > hi-php
> >
> > (the last line is the content of the file)
> > and still it is not in the cache
> >
> > does this help in finding an explanation?
> >
> > ----- Original Message -----
> > From: "Henrik Nordstrom" <hno@squid-cache.org>
> > To: "alp" <alpheus@gmx.de>
> > Cc: <squid-users@squid-cache.org>
> > Sent: Friday, February 14, 2003 8:04 PM
> > Subject: Re: [squid-users] squid and php-sites
> >
> > > Two questions:
> > >
> > > 1. What is your refresh_pattern settings?
> > >
> > > 2. What is the full headers returend by your server?
> > >
> > > Just tested this with Squid-2.5 and a reply with only a Date header
and
> > > some content is cached if your refresh_pattern says it should be.
> > >
> > >
> > > Note: The default refresh_pattern settings does not cache such replies
> > > for the reasons indicated before.
> > >
> > > Regards
> > > Henrik
> > >
> > >
> > > alp wrote:
> > > >
> > > > sorry, i misunderstood your first reply.
> > > > BUT:
> > > > i have a site test.php (without any php-code, just for testing the
> > suffix)
> > > > on an apache server.
> > > > it sends this site only with the DATE-header. no lastmod, no
expires. it
> > > > also does not mark the object as not cacheable.
> > > > so the refresh-pattern IS used, as you say.
> > > >
> > > > so, first call:
> > > > echo -e "GET /test.php HTTP/1.0\nHost:myhost\n\n" | netcat
squidserver
> > 80
> > > > gives the file together with the above header (date)
> > > > second call:
> > > > echo -e "GET /test.php
> > > > HTTP/1.0\nHost:myhost\ncache-control:only-if-cached\n\n" | netcat
> > > > squidserver 80
> > > > it says: object is not in cache.
> > > >
> > > > ???
> > > > doing the same with a file test.html i see the lastmod header and it
is
> > of
> > > > course cached.
> > > >
> > > > i still seem to miss some important point in understanding this, i
> > guess.
> > > > but for me it seems as if the refresh-pattern is not used.
> > >
>
Received on Sat Feb 15 2003 - 06:02:45 MST

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 17:13:24 MST