[squid-users] Cache html pages with advertised length of -1?

Alex Rousskov rousskov at measurement-factory.com
Thu Aug 15 16:17:44 UTC 2019


On 8/15/19 4:14 AM, Joshua Kronemeyer wrote:

> I'm trying to cache some HTML pages with squid, but the pages I'm trying
> to cache always advertise size of -1. (Advertised Size/Actual Size i.e.
> -1/104732)
> The http headers don't include a content-length.

> As per the store.log docs "If the advertised length is not zero, but not
> equal to the real length, the object will be released from the cache."
> Is there a way to get the size of this page in advance so squid can
> cache it or ignore the mismatch?

IIRC, in many cases, Squid can cache documents of unknown (a priori)
size. The store.log documentation you are looking at is probably talking
about size mismatches, which is a different special/problematic case.
The docs may also be out of sync with the actual logging code (e.g.,
saying "zero" instead of "negative").

You need to figure out whether Squid considers the response cachable.
You can start by using external tools like redbot.org often recommended
on this list. In some cases, looking at Squid debugging logs becomes
necessary to understand why Squid is not caching something (if it does
not) or why Squid is not serving a hit for the cached resource.

Alex.


More information about the squid-users mailing list