August 2017
Intermediate to advanced
278 pages
8h 53m
English
We set the proxy_cache_valid directive to cache the 200 responses and set them to be valid for 1 second (1s).
The validation value can be as low as your minimum content refresh. If you need changes to be live instantly, a 1 second timeout for the validation can be used. If you have less frequent changes, then setting 10-20 seconds can also be acceptable for many sites.
HTTP response codes of 200 represent an OK response, meaning it was a successful response from the server. We could also cache 404 requests (Not Found) as well, especially knowing that some of these can be quite resource intensive if they involve database searches.
Read now
Unlock full access