I dont think you can trigger that from PHP since the cache will hit before you have a chance to check.
- The
fastcgi_cache_valid
sets the cache time depending on the HTTP status code. In the example above, responses with status code 200, 301, 302 will be cached for 60 minutes. You can also use time period like12h
(12 hours) and7d
(7 days).
if you have
fastcgi_cache_path /tmp/nginx keys_zone=myzone:8m
just call
rm -Rf /tmp/nginx/*
which you could add in a page.updated:after hook with an exec php call.