[squid-users] Squid 4.2 : caching is not working

Alex Rousskov rousskov at measurement-factory.com
Fri Sep 7 17:30:20 UTC 2018


On 09/07/2018 10:46 AM, Hariharan Sethuraman wrote:

> squidclient -h localhost cache_object://localhost/ mgr:objects >>> this
> was showing the entry when the download was going on and disappeared
> after the download complete(~290MB) on the browser. When I checked the
> du of cache directory, it is intact with 200KB

Was the response cachable? You can use the redbot.org service to examine
the corresponding resource (URL).

If the service tells you that the resource was cachable in principle (or
if you cannot use the service), then you can post both HTTP request and
response headers (as received by Squid) here for further analysis. You
can collect those headers in cache.log by setting debug_options to ALL,2.


> (a) Please let me know what am missing to enable cache. 

I think your cache is enabled, but Squid refused to cache a particular
response you tested with. There is not enough information to say why.


> (b) Also "squidclient -h localhost cache_object://localhost/
> mgr:objects" hope this command will show the entry even after caching.

AFAICT, mgr:objects shows both in-progress transactions and cached
entries that do not belong to any in-progress transaction. However,
those cached entries will only be shown for UFS-based disk caches and
for a non-shared memory cache.

You are using a UFS-based cache. You should be (and probably are) using
a non-shared memory cache because you are using a UFS-based cache. In
summary, you most likely can use mgr:objects to see if the response was
cached. The above paragraph just answers your question in a way that may
be useful for others that have a different Squid configuration.


HTH,

Alex.


More information about the squid-users mailing list