Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 946
jdotjdot Avatar asked Aug 25 '16 14:08

jdotjdot


1 Answers

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

like image 146
Ronald Avatar answered Sep 27 '22 23:09

Ronald