Time for action – preventing the caching of local content
If we don't want to cache responses for certain requests or clients, we can deny it using this option. The default behavior is to allow all cacheable responses to be cached. As servers in our local area network are close enough that we may not want to waste cache space on our proxy server by caching responses from these servers, we can selectively deny caching for responses from local servers.
acl local_machines dst 192.0.2.0/24 198.51.100.0/24 cache deny local_machines
This code will prevent responses from the servers in the networks 192.0.2.0/24
and 198.51.100.0/24
from being cached by the proxy server.
What just happened?
To optimize the performance (especially the HIT ratio), we have configured Squid not to cache the objects that are available on the local area network. We have also learned how to selectively deny caching of such content.
Refresh patterns for cached objects
Squid provides the directive refresh_pattern
, using which...