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

Amos Jeffries squid3 at treenet.co.nz
Thu Aug 15 11:27:14 UTC 2019


On 15/08/19 8:14 pm, Joshua Kronemeyer wrote:
> Hello all!
> 
> 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.

So the objects are of unknowable length. Possibly infinite.

In store.log -1 means unknown/undefined. It is only a display value.
Which is correct, advertised size (Content-Length) was not provided.


> 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?

That would be the Content-Length header. Which you say the server is not
providing. Nothing anyone but the server admin can do about that.

When the Content-Length is not known that documented calculation is not
possible. Squid does cache objects with unspecified length unless there
is some _other_ reason not to.

Amos


More information about the squid-users mailing list