{"id":72017,"date":"2017-07-25T14:45:32","date_gmt":"2017-07-25T14:45:32","guid":{"rendered":"https:\/\/wordpress.org\/plugins\/nginx-cache-sniper\/"},"modified":"2018-09-27T15:11:24","modified_gmt":"2018-09-27T15:11:24","slug":"snipe-nginx-cache","status":"closed","type":"plugin","link":"https:\/\/bre.wordpress.org\/plugins\/snipe-nginx-cache\/","author":15532505,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"1.0.4.2","stable_tag":"1.0.4.2","tested":"4.9.29","requires":"4.6","requires_php":"","requires_plugins":"","header_name":"Cache Sniper for Nginx","header_author":"Thorn Technologies LLC","header_description":"Purge the Nginx FastCGI Cache within WordPress on a global or per-page basis.","assets_banners_color":"","last_updated":"2018-09-27 15:11:24","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"","header_author_uri":"","rating":4.8,"author_block_rating":0,"active_installs":100,"downloads":5140,"num_ratings":5,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":[],"upgrade_notice":{"1.0":"","1.0.1":"<p>Adds page cache invalidation on comment create\/update\/delete.<\/p>","1.0.2":"<p>Fixes a bug that caused cache_actions.js file not to load.<\/p>","1.0.3":"<p>Adds cache levels configuration.<\/p>","1.0.3.1":"<p>Clearing entire cache removes contents of the fastcgi_cache_path folder without deleting the folder itself.<\/p>","1.0.4":"<p>Adds ability to clear homepage cache.<\/p>","1.0.4.1":"<p>Fixes a bug that caused wp_insert_comment to fail.<\/p>","1.0.4.2":"<p>Fixed a bug that caused errors on post\/page delete.<\/p>"},"ratings":{"1":0,"2":0,"3":0,"4":"1","5":"4"},"assets_icons":{"icon-128x128.png":{"filename":"icon-128x128.png","revision":"1730050","resolution":"128x128","location":"assets"},"icon-256x256.png":{"filename":"icon-256x256.png","revision":"1730050","resolution":"256x256","location":"assets"}},"assets_banners":[],"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.0.1","1.0.2","1.0.3","1.0.3.1","1.0.4","1.0.4.1","1.0.4.2"],"block_files":[],"assets_screenshots":{"screenshot-1.png":{"filename":"screenshot-1.png","revision":"1943311","resolution":"1","location":"assets"}},"screenshots":{"1":"screenshot-1.png"},"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[1898,146,144,144300,2437],"plugin_category":[52],"plugin_contributors":[144303,144301,144302],"plugin_business_model":[],"class_list":["post-72017","plugin","type-plugin","status-closed","hentry","plugin_tags-aws","plugin_tags-cache","plugin_tags-caching","plugin_tags-invalidation","plugin_tags-nginx","plugin_category-performance","plugin_contributors-djrusk","plugin_contributors-ekaterir","plugin_contributors-robertchen617","plugin_committers-ekaterir"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/snipe-nginx-cache.svg","icon_2x":false,"generated":true},"screenshots":[{"src":"https:\/\/ps.w.org\/snipe-nginx-cache\/assets\/screenshot-1.png?rev=1943311","caption":"screenshot-1.png"}],"raw_content":"<!--section=description-->\n<p>Nginx has a built-in FastCGI cache, which acts as a reverse proxy cache at the webserver layer. The Cache Sniper for Nginx WordPress plugin lets you purge this cache from within WordPress. Here are some key features:<\/p>\n\n<ul>\n<li>Purge the entire cache from the menu bar<\/li>\n<li>Manually purge individual pages<\/li>\n<li>Manually purge homepage cache<\/li>\n<li>Configure pages to purge automatically when updated<\/li>\n<li>Configure pages to purge automatically when comments are created\/updated\/deleted.<\/li>\n<li>Configure Settings via WP CLI<\/li>\n<\/ul>\n\n<p>For more info on using this plugin with a pre-configured Nginx stack running in AWS, follow this <a href=\"https:\/\/aws.amazon.com\/marketplace\/pp\/B0771QTMR5\">link<\/a>.<\/p>\n\n<!--section=installation-->\n<ol>\n<li>Upload the plugin files to the <code>\/wp-content\/plugins\/snipe-nginx-cache<\/code> directory, or install the plugin through the WordPress plugins screen directly.<\/li>\n<li>Activate the plugin through the <strong>Plugins<\/strong> screen in WordPress<\/li>\n<li>Go to <strong>Tools<\/strong> -&gt; <strong>Nginx Cache Sniper<\/strong> to configure the plugin<\/li>\n<\/ol>\n\n<p><strong>Usage<\/strong><\/p>\n\n<ol>\n<li>Clear the entire cache by going to the <strong>Nginx Cache Sniper<\/strong> drop-down in the top <strong>Menu bar<\/strong>, and click <strong>Clear entire cache<\/strong>.<\/li>\n<li>Clear the homepage cache by going to the <strong>Nginx Cache Sniper<\/strong> drop-down in the top <strong>Menu bar<\/strong>, and click <strong>Clear homepage cache<\/strong>.<\/li>\n<li>To clear the cache for an individual Post (or Page), click on <strong>Clear cache for this page<\/strong>, either on the <strong>All Posts<\/strong> or Post detail pages.<\/li>\n<li>When configured to do so, you can purge the cache for a Post (or Page) by updating it.<\/li>\n<li>When configured to do so, you can purge the cache for a Post (or Page) where a comment was created\/updated\/deleted.<\/li>\n<\/ol>\n\n<p><strong>Configuration Settings<\/strong><\/p>\n\n<p>Cache Sniper for Nginx comes with the following settings:<\/p>\n\n<ol>\n<li><strong>Cache Path<\/strong>: This is the filesystem path where the FastCGI cache is stored on-disk. Set this to the value you used for <code>fastcgi_cache_path<\/code> from your Nginx configuration. <strong>Note<\/strong>: Nginx needs read\/write access to this location.<\/li>\n<li><strong>Cache Levels<\/strong>: This sets up a directory hierarchy under the cache path. Set this to the value you used for <code>levels<\/code> from your Nginx configuration. For example: <code>fastcgi_cache_path \/var\/lib\/nginx\/cache levels=1:2 keys_zone=CACHE:100m;<\/code><\/li>\n<li><strong>Automatically clear page cache on content update<\/strong>: Check this box to automatically purge the cache when a page is updated. This only purges the updated page -- it does not clear the entire cache.<\/li>\n<li><strong>Automatically clear page cache on comment<\/strong>: Check this box to automatically purge the cache when a comment is created\/updated\/deleted. This only purges the cache of the page where the comment resides -- it does not clear the entire cache.<\/li>\n<li><strong>Automatically clear homepage cache on content update<\/strong>: Check this box to automatically purge the homepage cache when a page is updated. This only purges the homepage -- it does not clear the entire cache or the cache of the page where the content resides.<\/li>\n<li><strong>Automatically clear homepage cache on comment<\/strong>: Check this box to automatically purge the the homepage cache when a comment is created\/updated\/deleted. This only purges the cache of the homepage -- it does not clear the entire cache or the cache of the page where the content resides.<\/li>\n<\/ol>\n\n<p><strong>Configuration via WP CLI<\/strong><\/p>\n\n<p>For those scripting out infrastructure, Cache Sniper for Nginx can be configured via WP CLI:<\/p>\n\n<ol>\n<li><code>wp plugin activate cache-sniper-nginx<\/code><\/li>\n<li><code>wp option add nginx_cache_sniper_path '\/var\/lib\/nginx\/cache'<\/code><\/li>\n<li><code>wp option add nginx_cache_sniper_levels '1:2'<\/code><\/li>\n<li><code>wp option add nginx_cache_sniper_auto_clear 1<\/code><\/li>\n<li><code>wp option add nginx_cache_sniper_auto_clear_comments 1<\/code><\/li>\n<li><code>wp option add nginx_cache_sniper_auto_clear_home_page 1<\/code><\/li>\n<li><code>wp option add nginx_cache_sniper_auto_clear_home_page_comments 1<\/code><\/li>\n<\/ol>\n\n<p>For instructions on setting up FastCGI caching with Nginx, refer to this <a href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-setup-fastcgi-caching-with-nginx-on-your-vps\">Digital Ocean blog post<\/a>.<\/p>\n\n<p><strong>Server-side configuration<\/strong><\/p>\n\n<p>There are a few things that need to be configured on the server in order for this plugin to work.<\/p>\n\n<ol>\n<li>Be sure to set <code>$scheme$request_method$host$request_uri<\/code> for <code>fastcgi_cache_key<\/code>. For example: <code>fastcgi_cache_key  \"$scheme$request_method$host$request_uri\";<\/code><\/li>\n<li>The Linux account running Nginx needs read-write permissions to the cache path on disk.<\/li>\n<\/ol>\n\n<!--section=faq-->\n<dl>\n<dt>Do I need to recompile Nginx to purge the cache?<\/dt>\n<dd><p>No. Cache Sniper for Nginx works without relying on any custom Nginx modules. This means you can easily keep Nginx updated with your normal package manager.<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>1.0.4.2<\/h4>\n\n<ul>\n<li>Fixed a bug that caused errors on post\/page delete.<\/li>\n<\/ul>\n\n<h4>1.0.4.1<\/h4>\n\n<ul>\n<li>Fixed a bug that caused wp_insert_comment to fail.<\/li>\n<\/ul>\n\n<h4>1.0.4<\/h4>\n\n<ul>\n<li>Automatically clearing the homepage cache on content create\/update\/delete.<\/li>\n<li>Manually clearing the homepage cache from the admin menu bar.<\/li>\n<li>Clearing post\/page cache when inserting a comment into the database using <code>wp_insert_comment<\/code>.<\/li>\n<\/ul>\n\n<h4>1.0.3.1<\/h4>\n\n<ul>\n<li>Clearing entire cache removes contents of the fastcgi_cache_path folder without deleting the folder itself.<\/li>\n<\/ul>\n\n<h4>1.0.3<\/h4>\n\n<ul>\n<li>Added cache levels configuration.<\/li>\n<\/ul>\n\n<h4>1.0.2<\/h4>\n\n<ul>\n<li>Fixed a bug that caused cache_actions.js file not to load.<\/li>\n<\/ul>\n\n<h4>1.0.1<\/h4>\n\n<ul>\n<li>Added support for page cache invalidation on comment create\/udpate\/delete.<\/li>\n<\/ul>\n\n<h4>1.0.0<\/h4>\n\n<ul>\n<li>First version, hope you like it!<\/li>\n<\/ul>","raw_excerpt":"Purge the Nginx FastCGI cache manually, or automatically when content is updated. Supports purging of individual pages.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/bre.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/72017","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bre.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/bre.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/bre.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=72017"}],"author":[{"embeddable":true,"href":"https:\/\/bre.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/ekaterir"}],"wp:attachment":[{"href":"https:\/\/bre.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=72017"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/bre.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=72017"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/bre.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=72017"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/bre.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=72017"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/bre.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=72017"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/bre.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=72017"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}