Angelo Höngens wrote:
On 19-11-2009 9:46, NublaII Lists wrote:
I have squid configured (working on it ;)) as a reverse proxy.
My understanding (and I can be wrong) is that once I request an image,
next requests for that image will not reach the web server in any way
until it expires, either manually or reaches end of life... is that
correct?
If you would have configured everything correctly, yes..
I am asking because I can see on my apache logs a ton of hits on
images that squid should be caching, and still arrive to the www
server, so either I don't have it configured properly or I don't
really understand how squid works on reverse proxy mode ;)
It should work like you say, but either squid is not configured
correctly, or the application tells squid not to cache. Squid decides
what it can cache, based on the response headers from the apache
application. Post those headers. The squidclient tool is really useful.
Run this on your squid machine (example, assuming your squid listens on
port 80):
squidclient -p 80 -h apacheserver http://domain/image.jpg | head -n 15
Increase or decrease the 'head -n X' value to show all the headers, but
not to return the binary content. It should return something like this:
HTTP/1.1 200 OK
Cache-Control: public
Content-Type: image/jpeg
Expires: Thu, 19 Nov 2009 09:08:51 GMT
Last-Modified: Thu, 19 Nov 2009 04:51:23 GMT
Server: Microsoft-IIS/7.0
X-AspNet-Version: 2.0.50727
X-Powered-By: ASP.NET
Date: Thu, 19 Nov 2009 08:54:51 GMT
Connection: close
Content-Length: 2845
Based on these response headers, Squid decides to cache or not.
Particularly interesting is the 'Cache-Control' header. From there on,
google further ;)
The tool provided by Yahoo! at http://www.redbot.org or the IRCache
cacheability engine prodvide useful reports for identifying what a proxy
can and cannot do with any given public URL.
Amos
--
Please be using
Current Stable Squid 2.7.STABLE7 or 3.0.STABLE20
Current Beta Squid 3.1.0.14