C3 Cloudfront Cache Controller
This is simple plugin that clear all cloudfront cache if you publish posts. You can easy use CloudFront in front of WordPress. Fixtures wp_is_mobile() Check device viewer type by CloudFront header. Now supports HTTP_CLOUDFRONT_IS_MOBILE_VIEWER and HTTP_CLOUDFRONT_IS_TABLET_VIEWER . preview url In pr
About this tool.
This is simple plugin that clear all cloudfront cache if you publish posts. You can easy use CloudFront in front of WordPress.
Fixtures
- wp_is_mobile() Check device viewer type by CloudFront header. Now supports HTTP_CLOUDFRONT_IS_MOBILE_VIEWER and HTTP_CLOUDFRONT_IS_TABLET_VIEWER .
- preview url In preview page, plugin add post_date query to avoid CloudFront cache. And set wordpress_loginuser_last_visit cookie for avoid CloudFront cache too.
The wordpress_loginuser_last_visit cookie will be removed if user sign out.
Invalidation(Clear Cache) Page URL
This plugin send following page url to CloudFront Invalidation API.
- TOP page URL
- Published Post Page URL
- Category Archive Page URL
AWS IAM Policy Example
{ "Version": "2012-10-17", "Statement": [ { "Action": [ "cloudfront:GetDistribution", "cloudfront:ListInvalidations", "cloudfront:GetStreamingDistribution", "cloudfront:GetDistributionConfig", "cloudfront:GetInvalidation", "cloudfront:CreateInvalidation" ], "Effect": "Allow", "Resource": "*" } ] }
Note: The cloudfront:GetInvalidation 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.
Adding your configuration through env vars
The plugin can be configured by defining the following variables:
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
- C3_DISTRIBUTION_ID
You can put these variables like the code into the wp-config.php
php define( 'AWS_ACCESS_KEY_ID', '' ); define( 'AWS_SECRET_ACCESS_KEY', '' ); define( 'C3_DISTRIBUTION_ID', '' );
Cookie
This plugin set a Cookie named wordpress_loginuser_last_visit to the user. It prevents CDN caching when the user is previewing his posts or contents. Once logging out from Dashboard, plugin removes this cookie from user.
7.1.0
- [Feature] Add invalidation detail view with modal popup showing invalidation paths, caller reference, and status