I have been trying to find a good and standard way of invalidating nginx
fastcgi cache. Some time ago we had the fastcgi_cache_bypass filter
which was not completely implemented and didn’t work (and has been
removed from the wiki since). Now the only option seems to be
Is there a way to cache that fresh response from the backend when
fastcgi_no_cache is 1?
- Nginx receives a request with fastcgi_no_cache 1
- Nginx skips cache and returns a fresh response from the backend
- Nginx stores that response in the cache
- All of the subsequent requests when fastcgi_no_cache 0 (with the same
cache_key) return that latest cached response.
Posted at Nginx Forum: