Search squid archive

Re: Squid 4.2 : caching is not working

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 view har save

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@xxxxxxxxxxxxx> 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@xxxxxxxxxxxxxxxxxxxxx
http://lists.squid-cache.org/listinfo/squid-users
_______________________________________________
squid-users mailing list
squid-users@xxxxxxxxxxxxxxxxxxxxx
http://lists.squid-cache.org/listinfo/squid-users

[Index of Archives]     [Linux Audio Users]     [Samba]     [Big List of Linux Books]     [Linux USB]     [Yosemite News]

  Powered by Linux