[squid-users] Caching uncachable resources

Amos Jeffries squid3 at treenet.co.nz
Tue Apr 25 14:52:53 UTC 2023


On 25/04/2023 9:45 pm, Andrey K wrote:
> Hello,
>
> We are trying to cache some resources, but they respond in the header 
> with the attributes that prevent caching:
>
>     Content-Type: video/MP2T
>     *Expires: Thu, 01 Jan 1970 00:00:01 GMT*
>     *Cache-Control: no-cache*
>     Cache: HIT
>     X-Cached-Since: 2023-04-25T07:43:41+00:00
>
> Thus, we see TCP_MISS in the logs.
> Is it possible to configure squid in such a way that it ignores 
> *Cache-control=no-cache* and *Expires *attributes and takes responses 
> from the cache?
>

This is **not** uncacheable. As shown by "Cache: HIT" there was an 
object found in the cache.

The "Expires" header is overridden by the existence of Cache-Control 
header. So ignore that.

The Cache-Control:no-cache actually means Squid can cache the response, 
but *must* contact the origin server before using a HIT.

For some reason the origin produced a newer version of the object thus 
the log says "MISS".

HTH
Amos


More information about the squid-users mailing list