Cache html pages with advertised length of -1?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Cache html pages with advertised length of -1?

Joshua Kronemeyer
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.

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?

Thanks!

_______________________________________________
squid-users mailing list
[hidden email]
http://lists.squid-cache.org/listinfo/squid-users
Reply | Threaded
Open this post in threaded view
|

Re: Cache html pages with advertised length of -1?

Amos Jeffries
Administrator
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
_______________________________________________
squid-users mailing list
[hidden email]
http://lists.squid-cache.org/listinfo/squid-users
Reply | Threaded
Open this post in threaded view
|

Re: Cache html pages with advertised length of -1?

Alex Rousskov
In reply to this post by Joshua Kronemeyer
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.
_______________________________________________
squid-users mailing list
[hidden email]
http://lists.squid-cache.org/listinfo/squid-users