{"id":40295,"date":"2015-11-27T09:58:18","date_gmt":"2015-11-27T09:58:18","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/c3-cloudfront-clear-cache\/"},"modified":"2026-03-23T07:54:56","modified_gmt":"2026-03-23T07:54:56","slug":"c3-cloudfront-clear-cache","status":"publish","type":"plugin","link":"https:\/\/pcd.wordpress.org\/plugins\/c3-cloudfront-clear-cache\/","author":13894222,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"7.3.2","stable_tag":"7.3.2","tested":"6.9.4","requires":"4.9.0","requires_php":"7.4","requires_plugins":null,"header_name":"C3 Cloudfront Cache Controller","header_author":"hideokamoto","header_description":"","assets_banners_color":"96d1df","last_updated":"2026-03-23 07:54:56","external_support_url":"","external_repository_url":"","donate_link":"http:\/\/wp-kyoto.net\/","header_plugin_uri":"https:\/\/github.com\/amimoto-ami\/c3-cloudfront-clear-cache","header_author_uri":"https:\/\/wp-kyoto.net\/","rating":4.3,"author_block_rating":0,"active_installs":3000,"downloads":275768,"num_ratings":3,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":{"2.0.0":{"tag":"2.0.0","author":"hideokamoto","date":"2015-11-30 03:29:50"},"2.0.1":{"tag":"2.0.1","author":"hideokamoto","date":"2015-11-30 03:41:08"},"6.1.4":{"tag":"6.1.4","author":"wokamoto","date":"2022-11-29 07:28:25"},"6.1.5":{"tag":"6.1.5","author":"wokamoto","date":"2023-03-11 07:11:58"},"7.0.0":{"tag":"7.0.0","author":"hideokamoto","date":"2025-07-30 05:09:58"},"7.0.1":{"tag":"7.0.1","author":"hideokamoto","date":"2025-07-31 06:41:46"},"7.1.0":{"tag":"7.1.0","author":"hideokamoto","date":"2025-08-01 00:37:26"},"7.2.0":{"tag":"7.2.0","author":"hideokamoto","date":"2025-08-18 00:50:50"},"7.3.0":{"tag":"7.3.0","author":"hideokamoto","date":"2025-09-24 00:36:10"},"7.3.1":{"tag":"7.3.1","author":"hideokamoto","date":"2026-02-18 06:51:37"},"7.3.1.1":{"tag":"7.3.1.1","author":"hideokamoto","date":"2026-02-20 09:44:24"},"7.3.2":{"tag":"7.3.2","author":"hideokamoto","date":"2026-03-23 07:54:56"}},"upgrade_notice":[],"ratings":{"1":0,"2":0,"3":0,"4":2,"5":1},"assets_icons":{"icon-128x128.png":{"filename":"icon-128x128.png","revision":3337009,"resolution":"128x128","location":"assets","locale":""},"icon-256x256.jpg":{"filename":"icon-256x256.jpg","revision":3337009,"resolution":"256x256","location":"assets","locale":""}},"assets_banners":{"banner-1544x500.png":{"filename":"banner-1544x500.png","revision":3337009,"resolution":"1544x500","location":"assets","locale":""},"banner-772x250.jpg":{"filename":"banner-772x250.jpg","revision":3337009,"resolution":"772x250","location":"assets","locale":""}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":["2.0.0","2.0.1","6.1.4","6.1.5","7.0.0","7.0.1","7.1.0","7.2.0","7.3.0","7.3.1","7.3.1.1","7.3.2"],"block_files":[],"assets_screenshots":[],"screenshots":[],"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[1898,3863,3875],"plugin_category":[],"plugin_contributors":[82693,162490,80328,86157,81224,78232,78030,78380,82956,78274],"plugin_business_model":[],"class_list":["post-40295","plugin","type-plugin","status-publish","hentry","plugin_tags-aws","plugin_tags-cdn","plugin_tags-cloudfront","plugin_contributors-amimotoami","plugin_contributors-bartoszgadomski","plugin_contributors-hideokamoto","plugin_contributors-hnle","plugin_contributors-jepser","plugin_contributors-johnbillion","plugin_contributors-megumithemes","plugin_contributors-miyauchi","plugin_contributors-pacifika","plugin_contributors-wokamoto","plugin_committers-amimotoami","plugin_committers-hideokamoto","plugin_committers-megumithemes","plugin_committers-wokamoto"],"banners":{"banner":"https:\/\/ps.w.org\/c3-cloudfront-clear-cache\/assets\/banner-772x250.jpg?rev=3337009","banner_2x":"https:\/\/ps.w.org\/c3-cloudfront-clear-cache\/assets\/banner-1544x500.png?rev=3337009","banner_rtl":false,"banner_2x_rtl":false},"icons":{"svg":false,"icon":"https:\/\/ps.w.org\/c3-cloudfront-clear-cache\/assets\/icon-128x128.png?rev=3337009","icon_2x":"https:\/\/ps.w.org\/c3-cloudfront-clear-cache\/assets\/icon-256x256.jpg?rev=3337009","generated":false},"screenshots":[],"raw_content":"<!--section=description-->\n<p>This is simple plugin that clear all cloudfront cache if you publish posts.\nYou can easy use CloudFront in front of WordPress.<\/p>\n\n<h3>Fixtures<\/h3>\n\n<ul>\n<li><p>wp_is_mobile()\nCheck device viewer type by CloudFront header.\nNow supports <code>HTTP_CLOUDFRONT_IS_MOBILE_VIEWER<\/code> and <code>HTTP_CLOUDFRONT_IS_TABLET_VIEWER<\/code>.<\/p><\/li>\n<li><p>preview url\nIn preview page, plugin add <code>post_date<\/code> query to avoid CloudFront cache.\nAnd set <code>wordpress_loginuser_last_visit<\/code> cookie for avoid CloudFront cache too.<\/p><\/li>\n<\/ul>\n\n<p>The <code>wordpress_loginuser_last_visit<\/code> cookie will be removed if user sign out.<\/p>\n\n<h4>Invalidation(Clear Cache) Page URL<\/h4>\n\n<p>This plugin send following page url to CloudFront Invalidation API.<\/p>\n\n<ul>\n<li>TOP page URL<\/li>\n<li>Published Post Page URL<\/li>\n<li>Category Archive Page URL<\/li>\n<\/ul>\n\n<h3>AWS IAM Policy Example<\/h3>\n\n<pre><code>{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Action\": [\n                \"cloudfront:GetDistribution\",\n                \"cloudfront:ListInvalidations\",\n                \"cloudfront:GetStreamingDistribution\",\n                \"cloudfront:GetDistributionConfig\",\n                \"cloudfront:GetInvalidation\",\n                \"cloudfront:CreateInvalidation\"\n            ],\n            \"Effect\": \"Allow\",\n            \"Resource\": \"*\"\n        }\n    ]\n}\n<\/code><\/pre>\n\n<p><strong>Note:<\/strong> The <code>cloudfront:GetInvalidation<\/code> permission is required for viewing detailed invalidation information. If this permission is not granted, the detail view feature will be disabled gracefully without affecting other plugin functionality.<\/p>\n\n<h3>Adding your configuration through env vars<\/h3>\n\n<p>The plugin can be configured by defining the following variables:<\/p>\n\n<ul>\n<li><code>AWS_ACCESS_KEY_ID<\/code><\/li>\n<li><code>AWS_SECRET_ACCESS_KEY<\/code><\/li>\n<li><code>C3_DISTRIBUTION_ID<\/code><\/li>\n<\/ul>\n\n<p>You can put these variables like the code into the wp-config.php<\/p>\n\n<pre><code>php\ndefine( 'AWS_ACCESS_KEY_ID', '' );\ndefine( 'AWS_SECRET_ACCESS_KEY', '' );\ndefine( 'C3_DISTRIBUTION_ID', '' );\n<\/code><\/pre>\n\n<h3>Cookie<\/h3>\n\n<p>This plugin set a Cookie named <code>wordpress_loginuser_last_visit<\/code> to the user.\nIt prevents CDN caching when the user is previewing his posts or contents.\nOnce logging out from Dashboard, plugin removes this cookie from user.<\/p>\n\n<h3>7.1.0<\/h3>\n\n<ul>\n<li>[Feature] Add invalidation detail view with modal popup showing invalidation paths, caller reference, and status<\/li>\n<li>[Fix] Fix invalid path returned for post type without archive page<\/li>\n<\/ul>\n\n<h3>7.0.1<\/h3>\n\n<ul>\n<li>[Update] Improved AWS API call processing for better security and PHP 8.x compatibility<\/li>\n<\/ul>\n\n<h3>7.0.0<\/h3>\n\n<ul>\n<li>[Breaking Change] Remove AWS SDK dependency and implement custom HTTP CloudFront API client<\/li>\n<li>[Update] Add comprehensive invalidation logging with c3_log_invalidation_list filter<\/li>\n<li>[Update] Add configurable CloudFront region and HTTP timeout settings<\/li>\n<\/ul>\n\n<h3>6.1.6<\/h3>\n\n<ul>\n<li>[Fix] Fixed PHP 8 syntax errors by adding nullable type hints<\/li>\n<li>[Fix] Fixed deprecation warnings about creation of dynamic properties in Invalidation_Service.php<\/li>\n<li>[Fix] Fixed deprecation warnings about creation of dynamic properties in Cron_Service.php<\/li>\n<li>[Fix] Fixed PHP 7.4 syntax errors in test files<\/li>\n<\/ul>\n\n<h3>6.1.5<\/h3>\n\n<ul>\n<li>[Fix] Changed to install the AWS SDK using composer instead of aws.phar.<\/li>\n<\/ul>\n\n<h3>6.1.4<\/h3>\n\n<ul>\n<li>[Update] Support post_type_archive_link<\/li>\n<\/ul>\n\n<h3>6.1.3<\/h3>\n\n<ul>\n<li>[Fix] Lost filter c3_invalidation_items From v6.0.0<\/li>\n<\/ul>\n\n<h3>6.1.2<\/h3>\n\n<ul>\n<li>[Fix] php version compare issue<\/li>\n<\/ul>\n\n<h3>6.1.1<\/h3>\n\n<ul>\n<li>[Fix] Plugin deactivation issue<\/li>\n<\/ul>\n\n<h3>6.1.0<\/h3>\n\n<ul>\n<li>[Update] Flush cache by post_ids<\/li>\n<\/ul>\n\n<h3>6.0.0<\/h3>\n\n<ul>\n<li>[Breaking Change] Re-write entire code<\/li>\n<li>[Update] Add <code>c3_log_cron_invalidation_task<\/code> filter to show cron job Logs<\/li>\n<li>[Update] Add <code>c3_aws_sdk_path<\/code> filter to change or remove bundled AWS SDK path<\/li>\n<\/ul>\n\n<h3>5.5.1<\/h3>\n\n<ul>\n<li>[Update] Replace the top level menu with a Settings submenu<\/li>\n<\/ul>\n\n<h4>5.5.0<\/h4>\n\n<ul>\n<li>[Update] Can use defined variables for AWS Credentials<\/li>\n<\/ul>\n\n<h4>5.4.2<\/h4>\n\n<ul>\n<li>[Bug fix] Set cookie path in preview page<\/li>\n<\/ul>\n\n<h4>5.4.1<\/h4>\n\n<ul>\n<li>[Bug fix] Undefined Paths index in invalidation query cron event<\/li>\n<\/ul>\n\n<h4>5.4.0<\/h4>\n\n<ul>\n<li>[Update] Update preview fix plugin<\/li>\n<\/ul>\n\n<h4>5.3.4<\/h4>\n\n<ul>\n<li>[Bug fix] Small bug fix<\/li>\n<\/ul>\n\n<h4>5.3.3<\/h4>\n\n<ul>\n<li>[Change SDK] replace sdk<\/li>\n<\/ul>\n\n<h4>5.3.2<\/h4>\n\n<ul>\n<li>[Bug fix] Use EC2 role if using as AMIMOTO Managed hosting<\/li>\n<\/ul>\n\n<h4>5.3.1<\/h4>\n\n<ul>\n<li>[Add filter] Can select AWS SDK version by filter<\/li>\n<\/ul>\n\n<h4>5.3.0<\/h4>\n\n<ul>\n<li>[Update SDK] Use AWS SDK v3 when you using php 5.6 or later<\/li>\n<\/ul>\n\n<h4>5.2.1<\/h4>\n\n<ul>\n<li>[For AMIMOTO Managed] bug fix to run by WP-CLI<\/li>\n<\/ul>\n\n<h4>5.2.0<\/h4>\n\n<ul>\n<li>[Add filter] We can disable to register wp-cron that retry request invalidation.<\/li>\n<li>[Readme] Update readme to see IAM Policy example.<\/li>\n<\/ul>\n\n<h4>5.1.0<\/h4>\n\n<ul>\n<li>[Update preview fixture] Set cookie to avoid CloudFront cache if user sign in<\/li>\n<li>[Update preview fixture] Unset cookie for avoide CloudFront cache if user sign out<\/li>\n<\/ul>\n\n<h4>5.0.0<\/h4>\n\n<ul>\n<li>Support CloudFront viewer params on <code>wp_is_mobile()<\/code>.(4.9.0 or later)<\/li>\n<\/ul>\n\n<h4>4.4.0<\/h4>\n\n<ul>\n<li>Fix small bug<\/li>\n<li>Add some feature for AMIMOTO Managed hosting user<\/li>\n<\/ul>\n\n<h4>4.3.1<\/h4>\n\n<ul>\n<li>Fix cron interval<\/li>\n<li>add filters <code>'c3_invalidation_interval<\/code>, <code>c3_invalidation_cron_interval<\/code>, <code>c3_invalidation_item_limits<\/code>.<\/li>\n<li>update default invalidation interval &amp; items.<\/li>\n<\/ul>\n\n<h4>4.3.0<\/h4>\n\n<ul>\n<li>Schedule cron event if you published many post at the same time<\/li>\n<\/ul>\n\n<h4>4.2.1<\/h4>\n\n<ul>\n<li>Fix 'c3_credential' filter position<\/li>\n<\/ul>\n\n<h4>4.2.0<\/h4>\n\n<ul>\n<li>Support AMIMOT Dashboard<\/li>\n<\/ul>\n\n<h4>4.1.0<\/h4>\n\n<ul>\n<li>Show Invalidation Logs<\/li>\n<\/ul>\n\n<h4>4.0.3<\/h4>\n\n<ul>\n<li>Auto Deploy by Travis<\/li>\n<\/ul>\n\n<h4>4.0.2<\/h4>\n\n<ul>\n<li>Add WP-CLI param check ( wp c3 flush)<\/li>\n<li>change transient_key<\/li>\n<\/ul>\n\n<h4>4.0.1<\/h4>\n\n<ul>\n<li>Bug fix ( conflict Nephila Clavata )<\/li>\n<\/ul>\n\n<h4>4.0.0<\/h4>\n\n<ul>\n<li>Support AWS SDK Version3<\/li>\n<li>Remove action hook -&gt; 'c3_add_setting_before'\nuse 'c3_after_title' filter hook instead.<\/li>\n<li>Remove action hook -&gt; 'c3_add_setting_after'\nuse 'c3_after_auth_form' filter hook instead.<\/li>\n<\/ul>\n\n<h4>3.0.0<\/h4>\n\n<ul>\n<li>Include CF Preview Fix plugin<\/li>\n<li>Rename<\/li>\n<\/ul>\n\n<h4>2.4.3<\/h4>\n\n<ul>\n<li>Fix Catch Exception BUG<\/li>\n<\/ul>\n\n<h4>2.4.2<\/h4>\n\n<ul>\n<li>Fix CLI BUG<\/li>\n<\/ul>\n\n<h4>2.4.1<\/h4>\n\n<ul>\n<li>Fix CLI BUG<\/li>\n<\/ul>\n\n<h4>2.4.0<\/h4>\n\n<ul>\n<li>Add WP-CLI Command ( Update Settings )<\/li>\n<\/ul>\n\n<h4>2.3.0<\/h4>\n\n<ul>\n<li>Add WP-CLI Command<\/li>\n<\/ul>\n\n<h4>2.2.2<\/h4>\n\n<ul>\n<li>Force Invalidation<\/li>\n<\/ul>\n\n<h4>2.2.1<\/h4>\n\n<ul>\n<li>Fix Typo<\/li>\n<\/ul>\n\n<h4>2.2.0<\/h4>\n\n<ul>\n<li>Add Filter for using EC2 Instance Role.<\/li>\n<li>Translationable in t.w.org<\/li>\n<\/ul>\n\n<h4>2.1.1<\/h4>\n\n<ul>\n<li>Fix too many invalidation url error.<\/li>\n<\/ul>\n\n<h4>2.1.0<\/h4>\n\n<ul>\n<li>Add hook to customize invalidation URL<\/li>\n<li>support new invalidation url, terms.<\/li>\n<li>Manualy invalidation button added<\/li>\n<\/ul>\n\n<h4>2.0.2<\/h4>\n\n<ul>\n<li>Change AWS SDK<\/li>\n<li>code refactoring by wokamoto<\/li>\n<li>Invalidation URL<\/li>\n<\/ul>\n\n<h4>2.0.1<\/h4>\n\n<ul>\n<li>Change AWS SDK<\/li>\n<li>code refactoring by wokamoto<\/li>\n<li>Invalidation URL<\/li>\n<\/ul>\n\n<h4>1.0<\/h4>\n\n<ul>\n<li>Initial released.<\/li>\n<\/ul>\n\n<h3>6.1.0<\/h3>\n\n<ul>\n<li>[Fix] Plugin deactivation issue<\/li>\n<\/ul>\n\n<!--section=installation-->\n<ol>\n<li>Activate the plugin through the 'Plugins' menu in WordPress<\/li>\n<li>Create IAM user to attach valid IAM Policy for AWS CloudFront<\/li>\n<li>Configure the plugin settings from wp-admin<\/li>\n<\/ol>\n\n<!--section=faq-->\n<dl>\n<dt id=\"when%20it%20send%20invalidation%20request%EF%BC%9F\"><h3>When it send invalidation request\uff1f<\/h3><\/dt>\n<dd><p>If post published,this plugin post invalidation request to CloudFront.<\/p><\/dd>\n<dt id=\"custom%20implementation\"><h3>Custom Implementation<\/h3><\/dt>\n<dd><p>This plugin now uses a custom AWS CloudFront implementation instead of the official AWS SDK to reduce dependencies and improve performance.<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>7.3.2<\/h4>\n\n<ul>\n<li>[Fix]\n\n<ul>\n<li>Exclude <code>.cursor<\/code> and <code>.github<\/code> from WordPress.org distribution package to prevent packaging conflicts<\/li>\n<\/ul><\/li>\n<li>[Maintenance]\n\n<ul>\n<li>Improve release workflow settings for WordPress.org asset\/readme sync stability<\/li>\n<li>Update release documentation for branch strategy and version consistency checks<\/li>\n<\/ul><\/li>\n<\/ul>\n\n<h4>7.3.1<\/h4>\n\n<ul>\n<li>[Fix]\n\n<ul>\n<li>Improved cache invalidation handling for posts transitioning between published and draft states, ensuring proper cache clearing during state changes<\/li>\n<li>Enhanced URL detection for more reliable CloudFront invalidation across different URL formats<\/li>\n<\/ul><\/li>\n<li>[Improvements]\n\n<ul>\n<li>Extended support for WordPress subdirectory installations to ensure proper cache path handling<\/li>\n<\/ul><\/li>\n<\/ul>\n\n<h4>7.2.0<\/h4>\n\n<ul>\n<li>[Feature] Add 3 new path adjustment hooks for more granular invalidation control:\n\n<ul>\n<li><code>c3_invalidation_post_batch_home_path<\/code> - Customize home path for single post invalidation<\/li>\n<li><code>c3_invalidation_posts_batch_home_path<\/code> - Customize home path for multiple posts invalidation<\/li>\n<li><code>c3_invalidation_manual_batch_all_path<\/code> - Customize path for manual \"clear all\" operations<\/li>\n<\/ul><\/li>\n<li>[Enhancement] Update Hooks.php to support variable arguments in apply_filters method<\/li>\n<li>[Compatibility] Maintain full backward compatibility with existing c3_invalidation_items filter<\/li>\n<\/ul>","raw_excerpt":"This is simple plugin that clear all cloudfront cache if you publish posts.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/40295","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=40295"}],"author":[{"embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/hideokamoto"}],"wp:attachment":[{"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=40295"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=40295"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=40295"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=40295"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=40295"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=40295"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}