Is it possible to configure varnish to behave as follows?
- When apache is up — serve content directly from apache (even if the object is cached in varnish) and also cache everything. Something like return(pass) but with caching.
- When apache is down — serve everything from cache.
Varnish is a cache server so using it only when something goes wrong is a little strange to me.
You can probably achieve what you want using some VCL but I think that will mean caching a new object for each request made, in my point of view it’s overkill.
I suggest you to cache whatever you want to cache even with a low TTL and use the Grace and Saint mode to fullfill you second point, user will be happy and so do you (I hope :)).