Reputation: 683
Is there a built-in way to clear the Nginx fastcgi_cache with PHP? I know I can write a PHP script that goes through and manually deletes all the cache files, but that seems too much like a hack.
Upvotes: 4
Views: 17008
Reputation: 131831
If you have
fastcgi_cache_path /tmp/nginx keys_zone=myzone:8m
just call
rm -Rf /tmp/nginx/*
It's really as simple as this: When you want to clean the cache, clean the cache :) (That in this case is just a folder)
Upvotes: 13