Search code examples
varnishvarnish-vclvarnish-4

Does Varnish cache 404s by default?


I was really surprised that I've had this much trouble finding this answer anywhere, but I can't.

With the built-in VCL in vcl_recv, etc., in Varnish 4.0+, does Varnish cache 404 responses by default?


Solution

  • Only the following status codes will be cached by default:

    200: OK
    203: Non-Authoritative Information
    300: Multiple Choices
    301: Moved Permanently
    302: Moved Temporarily
    304: Not modified
    307: Temporary Redirect
    410: Gone
    404: Not Found
    

    Source: http://book.varnish-software.com/4.0/chapters/VCL_Basics.html