> >> I am not sure if this is workable, is these a way for Varnish to cache 404 page? > > > > Varnish will do so by default. If it doesn't, it's because you have VCL or > > backend headers (Expires or Cache-Control) preventing the caching. > > Thanks Andreas, just realized that the backend server sets "Age: 0", > this might the reason why Varnish didn't cache 404 page.

No. Age is used to provide clients an indication of how long an object has been stored in a cache.

> By the way, if Varnish will cache 404 by default, what is the default > TTL for this? Is there a way to set a custom TTL for 404 caching?

Same as for every other object: derived from cache-control (max-age, s-maxage), expires or default_ttl