{"id":39853,"date":"2016-01-11T03:16:11","date_gmt":"2016-01-11T03:16:11","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/purgely\/"},"modified":"2016-06-15T16:55:26","modified_gmt":"2016-06-15T16:55:26","slug":"purgely","status":"publish","type":"plugin","link":"https:\/\/pcd.wordpress.org\/plugins\/purgely\/","author":8083681,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"1.0.1","stable_tag":"1.0.1","tested":"4.3.34","requires":"4.2.0","requires_php":"","requires_plugins":"","header_name":"Purgely","header_author":"Zack Tollman, WIRED Tech Team","header_description":"","assets_banners_color":"","last_updated":"2016-06-15 16:55:26","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"","header_author_uri":"","rating":5,"author_block_rating":0,"active_installs":10,"downloads":15584,"num_ratings":1,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","changelog"],"tags":[],"upgrade_notice":{"1.0.1":"<p>Update key saniziation to allow all capital letters, not just A-B.<\/p>","1.0.0":"<p>Initial release.<\/p>"},"ratings":{"1":0,"2":0,"3":0,"4":0,"5":"1"},"assets_icons":[],"assets_banners":[],"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.0.0","1.0.1"],"block_files":[],"assets_screenshots":[],"screenshots":[],"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[16700,144,29186,3853],"plugin_category":[52],"plugin_contributors":[78640],"plugin_business_model":[],"class_list":["post-39853","plugin","type-plugin","status-publish","hentry","plugin_tags-cache-invalidation","plugin_tags-caching","plugin_tags-fastly","plugin_tags-page-cache","plugin_category-performance","plugin_contributors-tollmanz","plugin_committers-tollmanz"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/purgely.svg","icon_2x":false,"generated":true},"screenshots":[],"raw_content":"<!--section=description-->\n<p>Purgely manages caching behavior for WordPress sites using Fastly as an edge caching solution. The plugin exposes useful\nAPIs to help control how pages on your site are cached, as well as provides sane defaults to make this a plug and play\nsolution for Fastly cache management.<\/p>\n\n<p>The plugin handles the following:<\/p>\n\n<ul>\n<li>Sets the <code>Surrogate-Control<\/code> header to control the expiration time for pages<\/li>\n<li>Sets the <code>stale-while-revalidate<\/code> and <code>stale-if-error<\/code> <code>Cache-Control<\/code> directives for managing these special Fastly\nbehaviors<\/li>\n<li>Set groups of <code>Surrogate-Keys<\/code> for all pages to provide purging across multiple pages with one command<\/li>\n<li>Provides invalidation of posts and related posts on save<\/li>\n<\/ul>\n\n<p>Each of these items have sane defaults with ways to override them and configure them to your liking.<\/p>\n\n<p>Additionally, the plugin exposes a WP CLI command to provide more flexible purging options.<\/p>\n\n<!--section=installation-->\n<h3>Manual installation<\/h3>\n\n<ol>\n<li>Upload the plugin directory to <code>\/wp-content\/plugins\/<\/code><\/li>\n<li>Activate the plugin through the 'Plugins' menu in WordPress<\/li>\n<\/ol>\n\n<h3>WP CLI installation<\/h3>\n\n<ol>\n<li>Run <code>wp plugin install --activate purgely<\/code><\/li>\n<\/ol>\n\n<h3>Configuration<\/h3>\n\n<p>Purgely provides a number of constants that can be used to control the behavior of the plugin and Fastly's cache. Users\nwho wish to change these values should define the constants in <code>wp-config.php<\/code>.<\/p>\n\n<p>After installing, you should define <code>PURGELY_FASTLY_KEY<\/code> and <code>PURGELY_FASTLY_SERVICE_ID<\/code> in <code>wp-config.php<\/code>. The plugin will work without them; however, you will not be able to purge by surrogate key or purge all without configuring these options. To define them copy the following code to your <code>wp-config.php<\/code> file, update the key to use your key, and the service ID to match the fastly service you're using:<\/p>\n\n<pre><code>`\n<\/code><\/pre>\n\n<p>define( 'PURGELY_FASTLY_KEY', '39c4820390d8f050giweda50268c7583' );\ndefine( 'PURGELY_FASTLY_SERVICE_ID', 'abcdefghijklmn1234567890' );\n    `<\/p>\n\n<p>Configuring other constants is similarly done by defining the constant in <code>wp-config.php<\/code>. All constants are explained\nbelow.<\/p>\n\n<p><strong>PURGELY_API_ENDPOINT<\/strong><\/p>\n\n<p>Defines the API endpoint for Fastly. This should not usually need to be changed, but is added in the event that Fastly\ndecides to use a different API endpoint, or if there is a need for a user to have a special endpoint.<\/p>\n\n<p><em>default: (string) ''<\/em><\/p>\n\n<p><strong>PURGELY_ALLOW_PURGE_ALL<\/strong><\/p>\n\n<p>Determines whether or not the plugin can issue a purge all request. Purge all can have dire consequences for a website.\nAs such, this behavior is disabled by default. If can be turned on by setting this value to <code>true<\/code>.<\/p>\n\n<p><em>default: (bool) false<\/em><\/p>\n\n<p><strong>PURGELY_ENABLE_STALE_WHILE_REVALIDATE<\/strong><\/p>\n\n<p>Determines whether or not the plugin sets the <code>stale-while-revalidate<\/code> directive for the <code>Cache-Control<\/code> header. Setting\nthis value to <code>false<\/code> will turn off the <code>stale-while-revalidate<\/code> behavior. Note that you can manually control this\nbehavior via the functions exposed in the plugin regardless of this configuration option. This option only controls the\ndefault plugin behavior.<\/p>\n\n<p><em>default: (bool) true<\/em><\/p>\n\n<p><strong>PURGELY_STALE_WHILE_REVALIDATE_TTL<\/strong><\/p>\n\n<p>Sets the TTL for the <code>stale-while-revalidate<\/code> directive in seconds. The value instructs Fastly to continue serving stale\ncontent while new content is generated for the duration of the value that is set.<\/p>\n\n<p><em>default: (int) 86400<\/em><\/p>\n\n<p><strong>PURGELY_ENABLE_STALE_IF_ERROR<\/strong><\/p>\n\n<p>Determines whether or not the plugin sets the <code>stale-if-error<\/code> directive for the <code>Cache-Control<\/code> header. Setting\nthis value to <code>false<\/code> will turn off the <code>stale-if-error<\/code> behavior. Note that you can manually control this\nbehavior via the functions exposed in the plugin regardless of this configuration option. This option only controls the\ndefault plugin behavior.<\/p>\n\n<p><em>default: (bool) true<\/em><\/p>\n\n<p><strong>PURGELY_STALE_IF_ERROR_TTL<\/strong><\/p>\n\n<p>Sets the TTL for the <code>stale-if-error<\/code> directive in seconds. The value instructs Fastly to continue serving stale\ncontent while the origin site is serving an error for the duration of the value that is set.<\/p>\n\n<p><em>default: (int) 86400<\/em><\/p>\n\n<p><strong>PURGELY_SURROGATE_CONTROL_TTL<\/strong><\/p>\n\n<p>Sets the TTL for the <code>Surrogate-Control<\/code> header in seconds. This value is the default TTL for all pages on your site,\nunless it is cached within the app. Changing this value changes the value for the whole site.<\/p>\n\n<p><em>default: (int) 300<\/em><\/p>\n\n<!--section=changelog-->\n<h4>1.0.1<\/h4>\n\n<ul>\n<li>Update key saniziation to allow all capital letters, not just A-B.<\/li>\n<\/ul>\n\n<h4>1.0.0<\/h4>\n\n<ul>\n<li>Initial release.<\/li>\n<\/ul>","raw_excerpt":"A plugin to manage Fastly caching behavior and purging.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/39853","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=39853"}],"author":[{"embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/tollmanz"}],"wp:attachment":[{"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=39853"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=39853"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=39853"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=39853"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=39853"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=39853"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}