WP Manifestindependent plugin directory
manifest / performance / wp-cloudfront-cache-clear

CloudFront Cache Clear

CloudFrontキャッシュを削除できるWordPressプラグイン。

★ 0stars

Install

Download source zip No release zip yet

This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.

Install straight from GitHub with WP-CLI:

wp plugin install https://github.com/kanadeya/wp-cloudfront-cache-clear/archive/refs/heads/main.zip
No built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.

WordPressの管理画面からCloudFrontのキャッシュクリアを実行するプラグインです。

Requirements

  • PHP 8.0+
  • WordPress
  • Composer
  • EC2 IAM Role with cloudfront:CreateInvalidation

Installation

cd /path/to/wordpress/wp-content/plugins
git clone <repository-url> cloudfront-cache-clear
cd cloudfront-cache-clear
composer install --no-dev

WordPress管理画面から CloudFront Cache Clear を有効化してください。

Settings

設定 > CloudFront Cache Clear で以下を設定します。

  • Distribution ID
  • Invalidation Paths

Invalidation Paths は1行に1パスを入力します。初期値は /* です。

AWS IAM Policy

EC2に付与するIAMロールには、最低限以下の権限が必要です。

{
  "Effect": "Allow",
  "Action": [
    "cloudfront:CreateInvalidation"
  ],
  "Resource": "*"
}

AWSアクセスキーはWordPressに保存しません。AWS SDKのデフォルト認証チェーンにより、EC2のIAMロールを利用します。