# Yet another "Squid won't cache"--but I can't see the problem

## vputz

I had squid running for quite some time (the config file was from 3.1.22 and I never updated it much).  The recent update to 3.2.9, though, has gone a bit strange in that ... well, it's not that I see any errors, it just stopped caching everything.

So I figured "I'll just start with the minimum config, add my cache_dir, and see what happens"--and again, nothing's getting cached.  Everything's passing through OK, so I don't think it's an ACL issue.  But I set the debug level to 2, and watched cache.log...

```

 # tail -f /var/log/squid/cache.log | grep Cachable

2013/03/28 18:25:08.746 kid1| store.cc(984) checkCachable: StoreEntry::checkCachable: NO: not cachable

2013/03/28 18:25:10.803 kid1| store.cc(984) checkCachable: StoreEntry::checkCachable: NO: not cachable

2013/03/28 18:25:12.137 kid1| store.cc(984) checkCachable: StoreEntry::checkCachable: NO: not cachable

2013/03/28 18:25:26.178 kid1| store.cc(984) checkCachable: StoreEntry::checkCachable: NO: not cachable

...

```

But NOTHING's cachable, from any site.  "grep HIT /var/log/squid/access.log" always returns no lines.  Squid appears to have permission to write (because clearing the cache directory and doing "squid -z" populates it with directories).

I'm baffled.  I know the minimal install doesn't cache much, but I figured it would cache something.  Is there something obvious I'm missing (and pointers to a good way to test?)

```

acl Safe_ports port 443         # https

acl Safe_ports port 70          # gopher

acl Safe_ports port 210         # wais

acl Safe_ports port 1025-65535  # unregistered ports

acl Safe_ports port 280         # http-mgmt

acl Safe_ports port 488         # gss-http

acl Safe_ports port 591         # filemaker

acl Safe_ports port 777         # multiling http

acl Safe_ports port 901         # SWAT

acl CONNECT method CONNECT

#

# Recommended minimum Access Permission configuration:

#

# Only allow cachemgr access from localhost

http_access allow localhost manager

http_access deny manager

# Deny requests to certain unsafe ports

http_access deny !Safe_ports

# Deny CONNECT to other than secure SSL ports

http_access deny CONNECT !SSL_ports

# We strongly recommend the following be uncommented to protect innocent

# web applications running on the proxy server who think the only

# one who can access services on "localhost" is a local user

#http_access deny to_localhost

#

# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS

#

# Example rule allowing access from your local networks.

# Adapt localnet in the ACL section to list your (internal) IP networks

# from where browsing should be allowed

http_access allow localnet

http_access allow localhost

# And finally deny all other access to this proxy

http_access deny all

# Squid normally listens to port 3128

http_port 3128

# Uncomment and adjust the following to add a disk cache directory.

#cache_dir ufs /var/cache/squid 100 16 256

cache_dir ufs /mnt/squidcache 7000 16 256

# Leave coredumps in the first cache dir

coredump_dir /var/cache/squid

debug_options ALL,2

# Add any of your own refresh_pattern entries above these.

refresh_pattern ^ftp:           1440    20%     10080

refresh_pattern ^gopher:        1440    0%      1440

refresh_pattern -i (/cgi-bin/|\?) 0     0%      0

refresh_pattern .               0       20%     4320

```

----------

## vputz

Well, after a few hours, still nothing was cached except, inexplicably (to me) chunks from a downloading Steam game.  So with a few explicit refresh_patterns, a few things are now caching.  Not everything I want, but at least I have some faith that squid hasn't completely gone mad.

Odd about the steam chunks, though.

----------

## lewisifer

Well, this post is only one year overdue, so hopefully you've moved past this problem, but on the chance you haven't, it might be a good idea to explicitly set these properties

maximum_object_size 200 MB

range_offset_limit 200 MB

quick_abort_min -1

read_ahead_gap 50 MB

Be careful about quick_abort_min, since in my case I wanted the cache to download even if the user aborted the request. The MB values are all random as I wanted it to cache a 100mb movie file.

Lastly make absolutely sure that these properties are declared BEFORE the cache_dir property, since cache settings specified after that declaration are overridden by default values (which is the dumbest thing ever and took me 2 days of hair tearing frustration to figure out)

Anyway, hope that helps.

----------

