Squid and 304 Not Modified
If a client has a cached image, and then makes a If-Modified-Since (IMS) request to a server via a Squid Reverse Proxy, and if Squid doesn’t already have the file in its cache, then Squid by default will forward the request to the server, and the server will respond with “304 Not Modified”. However, squid will not remember the response, and continue forwarding future IMS requests since the cache is still empty .
Solution
# TAG: ignore_ims_on_miss on|off
# This options makes Squid ignore If-Modified-Since on
# cache misses. This is useful while the cache is
# mostly empty to more quickly have the cache populated.
#
#Default:
#ignore_ims_on_miss off
ignore_ims_on_miss on
You will also need to make sure the refresh_pattern is set.
e.g.
refresh_pattern (/images/) 10080 100% 10080 ignore-reload override-lastmod
About this entry
You’re currently reading “ Squid and 304 Not Modified ,” an entry on Chui's Counterpoint
- Published:
- 1.21.11 / 7pm
- Category:
- Engineering notes
Comments are closed
Comments are currently closed on this entry.