0

I am wondering how to configure squid (or tinyproxy) to cache EVERYTHING and return HTTP 200 hits, even on Internet outage or if original source is 404?

Basically, I want squid to look in the cache and return whatever it finds there.

I have read the config files for each. Tiny does not seem very configurable at all, and while squid has lots of options, I could not find the option to return hits even if the original site is offline or the link 404.

Prof. Falken
  • 292
  • 7
  • 16

1 Answers1

1

Squid has the option offline_mode which will always serve content from cache, if it is present there.

It is neither a safe general purpose option, nor a recommended, but can be useful in some occasions. But expect some odd web browsing experiences.

HBruijn
  • 72,524
  • 21
  • 127
  • 192
  • Perfect for my situation - I have a web scraper written in Python, so I use squid as proxy. Now I can rerun my script on historic data, without having to harass the web server with new requests. It's really quite a saver - it minimizes the traffic seen on the web server, and it makes testing tweaks to the parsing code locally much faster on my end. Since all the data is historic and from 2014 at the latest, there is no worry that I might be missing updates. Missing updates is good - I want the data as it was seen. – Prof. Falken Mar 28 '15 at 12:04