Dmitry Suhodoev wrote:

> hi, squid-users!
>
> i have the squid 2.4-STABLE6 on my proxy server, and i very want reduce
> consuption of traffic.
>
> how i configure squid to release the following algorithm?
>
> 1. user try to download something (let it
> http://www.some-server.com/test.html)
> from proxy (my squid).
> 2. squid must see to his own cache to hear size, date and time of
> cached test.html.
> 3. now squid looks to real http://www.some-server.com/test.html to
> hear his
> size, date and time.
> 4. if first and second size, date or time different, only then squid will
> download this real file, store in his cache and transfer it to user.
> 5. of course if file not exist in cache, then squid immediately
> downloads the
> file.
>
> i.e. i want make to my squid will ignore all "no-cache" and other http
> attributes, and will use only this algorithm.
>
> it is possible? if not, how i can reduce consuption of traffic by
> tuning squid
> with action like this algorithm?
>
> ps. or i'm full stupid, that thing this algorithm?



You're not full stupid, Dmitry, but probably at least half stupid. ;-)

If you have a standard proxy (not reverse proxy where you control the
backend data), you /never/ want to disable all of the above safeguards
against serving stale data in Squid. There are many circumstances in
which the wrong data, such as data intended for a different recipient,
could be served by the origin server. Expiry and cache-control headers
are used in weird ways out in the real world, and it is hard to guess
what your cache is going to run into. Ignoring some of them will cause
problems with some sites. Ignoring all of them will cause problems with
a /lot/ of sites.

You can tune some parameters to improve hit ratios, but completely
disabling all of the checks isn't a wise choice in a cache with more
than one user (ever, not just simultaneously).

What I would recommend, is to first turn up the percent in refresh
pattern '.' from 20% to, say, 35%. Also increase the maximum lifetime
from 4320 to something like twice that. Increasing the minimum age is
also probably minimally risky...just don't go overboard--more than a
couple of hours is probably asking for trouble.

That will probably gain you another 5% or so hit ratio. To get much
beyond that, you'll have to start breaking the HTTP rules, which is not
recommended. The least harmful might be to enable 'reload-into-ims'.
Beyond that I wouldn't suggest use of any of the other refresh pattern
options.
--
Joe Cooper
Web caching appliances and support.
http://www.swelltech.com