[squid-users] Squid 4.2 : caching is not working
Hariharan Sethuraman
srnhari at gmail.com
Sat Sep 8 04:14:28 UTC 2018
Hi,
I see the response can be cached. Will try out increasing logging level of
cache.log
HTTP/1.1 200 OK
Date: Sat, 08 Sep 2018 04:10:38 GMT
Server: Apache/2.2
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/plain;; charset=ISO-8859-1
response headers: 203 bytes body: 21 bytes transfer overhead: 9 bytes
view body
<https://redbot.org/?uri=https%3A%2F%2Fdl.cisco.com%2Fpcgi-bin%2Fswdld%2Fdownload.cgi%3Fdwnld_code%3DxhMnkw8Z-oFg8Jvk7BeSZnkmIdO48GTAA01cTlDABiH7c9QJsq9s5ypIQWgQxY4cI66yKQsWgjvIpCgr8_DGemwm_6VqWfSJQ8Xonly7l-DcKbz9kqMQXOHnp2G1BHj_-wp1DhAskLOUpvRG2oeR_f_FxYTyLVHIN5esRF-LXOUKwkwyT0TOf6xO-AUm3KaM&req_hdr=Authentication%3ABearer+HQdHyp1lCj2cZxGYPlzEqlEuGxww#>
view har
<https://redbot.org/?id=9ml2eaa9&req_hdr=Authentication%3ABearer%20HQdHyp1lCj2cZxGYPlzEqlEuGxww&req_hdr=User-Agent%3ARED/1%20(https://redbot.org/)&req_hdr=Referer%3Ahttps://dl.cisco.com/pcgi-bin/swdld/download.cgi?dwnld_code%3DxhMnkw8Z-oFg8Jvk7BeSZnkmIdO48GTAA01cTlDABiH7c9QJsq9s5ypIQWgQxY4cI66yKQsWgjvIpCgr8_DGemwm_6VqWfSJQ8Xonly7l-DcKbz9kqMQXOHnp2G1BHj_-wp1DhAskLOUpvRG2oeR_f_FxYTyLVHIN5esRF-LXOUKwkwyT0TOf6xO-AUm3KaM&check_name=default&format=har>
save
<https://redbot.org/?uri=https%3A%2F%2Fdl.cisco.com%2Fpcgi-bin%2Fswdld%2Fdownload.cgi%3Fdwnld_code%3DxhMnkw8Z-oFg8Jvk7BeSZnkmIdO48GTAA01cTlDABiH7c9QJsq9s5ypIQWgQxY4cI66yKQsWgjvIpCgr8_DGemwm_6VqWfSJQ8Xonly7l-DcKbz9kqMQXOHnp2G1BHj_-wp1DhAskLOUpvRG2oeR_f_FxYTyLVHIN5esRF-LXOUKwkwyT0TOf6xO-AUm3KaM&req_hdr=Authentication%3ABearer+HQdHyp1lCj2cZxGYPlzEqlEuGxww#>
General
- The Content-Type header's syntax isn't valid.
- The Keep-Alive header is deprecated.
- The server's clock is correct.
Caching
- This response allows all caches to store it.
- This response allows a cache to assign its own freshness lifetime.
Thanks,
Hari
On Fri, Sep 7, 2018 at 11:01 PM Amos Jeffries <squid3 at treenet.co.nz> wrote:
> On 8/09/18 4:46 AM, Hariharan Sethuraman wrote:
> > Hi team,
> >
> > I have created directories using squid -z and then triggered squid -f
> > /etc/squid/squid.conf -NYCd 1. Find (1) debug info below. And below (2)
> > are the cache directory and squid-config.
> >
> > (1) - debug info:
> > squidclient -h localhost cache_object://localhost/ mgr:objects >>> this
>
> You do not need to pass squidclient the cache_object: URLs, nor
> localhost as server. Just:
>
> squidclient mgr:objects
>
> Also, what *exactly* did that report tell you?
> "cache" is more than just the disk storage area.
>
>
> > was showing the entry when the download was going on and disappeared
> > after the download complete(~290MB) on the browser.
>
>
> What I am thinking reading that is that probably Squid used the cache
> storage area as a temporary location for the bytes of a very large
> object, but then removed it once the response was completely delivered
> since it was not cacheable.
>
> Details matter. The "~" means "approximately" and your config says
> *exactly* 300 MByte is the upper limit.
>
> So an object which is "approximately 290" may in truth be *over* 300
> and thus not permitted to cache.
>
>
> NP: you can use the tool at redbot.org to check URL cacheability. It
> will also tell you about any caching related HTTP compliance issues with
> that resource.
> Or you can set "debug_options 11,2" in your squid.conf and check the
> exact HTTP messages your proxy is dealing with.
>
>
> When I checked the
> > du of cache directory, it is intact with 200KB
>
> ...
> > ..
> > cache allow all
> > strip_query_terms off
>
>
> Above are defaults. No need to configure since Squid-3.
>
> > ..
> > cache_dir ufs /var/spool/squid/cache 2000 16 256
> > maximum_object_size 300 MB
> > ..
> > range_offset_limit -1
> > ..
> > url_rewrite_access allow all
> > url_rewrite_program /usr/bin/python /usr/share/proxypass.py
>
> Not relevant, except that when testing the URL like with redbot.org you
> need to use the URL this helper produces instead of what was passed into
> Squid by the client.
>
>
> >
> > http_access deny all
> > ...
> > always_direct deny all
> >
> > (a) Please let me know what am missing to enable cache.
>
> Cache is enabled and Squid caches as much as it can by default - within
> the limits prescribed by HTTP specification and your config settings.
>
> So the only thing to do is ensure that you do not actively *prevent*
> caching from happening somehow.
>
>
> > (b) Also "squidclient -h localhost cache_object://localhost/
> > mgr:objects" hope this command will show the entry even after caching.
> >
>
> It (well, "squidclient mgr:objects") should show all objects currently
> known to the proxy. That will mostly be cached objects (both disk and
> in-memory), but also included temporary in-transit objects.
>
> Amos
> _______________________________________________
> squid-users mailing list
> squid-users at lists.squid-cache.org
> http://lists.squid-cache.org/listinfo/squid-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squid-cache.org/pipermail/squid-users/attachments/20180908/4614c6f8/attachment-0001.html>
More information about the squid-users
mailing list