Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Added the option to purge cache files directly without ngx_cache_purge #78
I needed to be able to purge cache files without using the ngx_cache_purge module.
This pull request adds an option to the "Purge Options" area to allow the site admin to choose how cache files should be purged. The default option is to use a GET request to the /purge version of the URL, as required by ngx_cache_purge. The second option lets the plugin directly remove the cache files from the server.
Screenshot of new option:
How it works
I followed information from this article to compute the correct cache file to delete. The URL to delete is hashed with md5 and then given a specific folder and file name based on that hash.
In order for the "delete local files" option to work, the following must all be true:
So far it seems to work on my staging server tests. If someone else can help double check that everything is working great that would be much appreciated.