On 17/12/2011 5:39 a.m., J Smith wrote:

Hello everyone,

I'm new to squid. I think I have it configured to do what I want, but I wanted 
to run my squid.conf options (pertinent parts only) by more experienced eyes to 
double-check.

I'm running squid (2.7.STABLE7) as a forward proxy on my personal computer, 
with the sole purpose of caching frequently-used static content from a few 
specific sites. Nothing else should get cached. Furthermore, once the content 
is cached, it does not need to be revalidated.

Here goes:

# List sites to be cached
acl cache_us dstdomain a.example.com
acl cache_us dstdomain b.example.com

# Allow access from my computer only
http_access allow localhost
http_access deny all

# Only cache "cache_us"
cache deny !cache_us

# Once cached, do not revalidate
offline_mode on

A couple of questions:

* From my scan of the log files, this appears to work. Any reason why it won't 
work, hidden pitfalls, etc.?

The usual pitfalls of force-caching things which are borderline for cacheability. Broken page contents when any piece of the original page changes.

The best way to achieve caching performance is to alter the origin server(s) for these sites to produce cache-controls allowing their content to be cached for the correct timespan.


* With "offline_mode on," I'm assuming that other cache-tuning options (e.g., 
max_stale, refresh_pattern, minimum_expiry_time, etc.) are irrelevant;
squid will cache matching content once, always fetch it from the cache in the 
future, and never revalidate it. Right?

They are still relevant. Squid just does not erase the cached content and serves up stale objects without explicit permission from the origin when failures occur.


* How/where are validation requests logged?

It shows up in the access.log as the result codes (TCP_*) with the "REFRESH" or "RELOAD" sub-tag when each transaction finishes. http://wiki.squid-cache.org/SquidFaq/SquidLogs#Squid_result_codes has the details on what these tags are and mean.


Amos

Reply via email to