amandawulf
amandawulf

Reputation: 683

How do I clear fastcgi_cache with PHP?

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

Answers (1)

KingCrunch
KingCrunch

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

Related Questions