| 开发者 |
bytecorestack
stephen97 |
|---|---|
| 更新时间 | 2026年8月18日 20:50 |
| PHP版本: | 7.2 及以上 |
| WordPress版本: | 7.0 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
ResetDistributionCache action on your Lightsail distribution — a dedicated cache management plugin for Lightsail, not a generic multi-CDN tool with Lightsail bolted on as an afterthought.
Use it to manually purge your Lightsail CDN cache with one click, fire an automatic cache clear the instant you publish or update content, or set a scheduled cache clear so your cache invalidates itself on its own — hourly, daily, weekly, monthly, or at custom intervals.
Why Use This Plugin?
If you've wished WordPress cache management for Lightsail was as simple as clicking a button, this is it:
wp bcs-lsm flush
define('AWS_ACCESS_KEY_ID', 'your_access_key_here'); define('AWS_SECRET_ACCESS_KEY', 'your_secret_key_here'); define('AWS_DEFAULT_REGION', 'us-east-1'); define('LIGHTSAIL_DISTRIBUTION_NAME', 'your_distribution_name');
Finding Your Distribution Name:
Install and activate this plugin, add your AWS credentials to wp-config.php, then go to Settings > Lightsail Manager and click "Clear CDN Cache Now." No need to log in to the AWS console at all.
AWS Lightsail CDN is a content delivery network service from Amazon Web Services that caches your website content at edge locations worldwide, making your site faster for visitors globally.
Yes, you need an AWS account with an active Amazon Lightsail distribution and appropriate IAM permissions.
You can create AWS credentials (Access Key ID and Secret Access Key) from the AWS IAM console. Make sure the credentials have permissions to manage Lightsail distributions (see the Configuration section above for the exact actions required).
Use the built-in "Test Connection" button on the Configuration tab. It verifies your access key, secret key, and distribution name against the AWS Lightsail API without clearing your cache, and tells you exactly what's wrong if something fails.
Yes, the plugin uses AWS Signature Version 4 for secure authentication. Your credentials are stored in wp-config.php (not in the database) and are never exposed in the admin interface.
Amazon Lightsail CDN is the simplified content delivery network bundled with Lightsail distributions, while CloudFront is AWS's standalone, more advanced CDN. This plugin is built specifically for Lightsail CDN distributions — if you're using CloudFront instead, you'll need a CloudFront-specific plugin.
Yes. Enable Auto-Clear in the plugin and choose which post types (posts, pages, products, or any custom post type) should trigger an automatic cache invalidation whenever they're published or updated.
Yes! The plugin supports interval, weekly, and monthly scheduling with customizable times. You can choose the exact time and day/date for cache clearing, with a live countdown to the next run.
The plugin will display an error message with details about what went wrong. Common issues include incorrect credentials or an incorrect distribution name — use "Test Connection" to diagnose this before it happens.
No, cache clearing operations happen in the background and don't affect your site's performance. The plugin only communicates with AWS when you manually clear cache, when content is updated (if auto-clear is enabled), or during scheduled clears.
Yes. WooCommerce registers its products as a custom post type, so you can enable auto-clear for products to keep your storefront's CDN cache fresh whenever inventory or product details change.
No — this is an AWS Lightsail API limitation, not a plugin limitation. The ResetDistributionCache action Lightsail exposes has no path/pattern parameter, so every clear (manual, automatic, scheduled, or WP-CLI) always resets the entire distribution. If you need per-path invalidation, that capability exists on Amazon CloudFront, not Lightsail CDN.
Yes. The Activity Log tab lists every manual, automatic, scheduled, and WP-CLI cache clear with its timestamp, status, and trigger reason, stored locally in your WordPress database (Lightsail has no live invalidation-history API to pull from). It's paginated and can be cleared from the same tab.
Yes. Run wp bcs-lsm flush to reset the CDN cache from WP-CLI — useful for firing a cache clear automatically after a deploy. Every CLI-triggered clear is recorded in the Activity Log.
The plugin is compatible with WordPress multisite installations. Each site can have its own cache clearing schedule.
Yes. ByteCoreStack - Lightsail CDN Cache Manager is completely free with no premium upsell, no ads, and no artificially limited features — every capability described in this readme (manual clear, auto-clear, scheduling, Activity Log, WP-CLI) is included.
Amazon Lightsail CDN caches content at edge locations, so updates you make in WordPress don't reach visitors until that cache is reset. This is exactly the problem this plugin solves — enable Auto-Clear so every publish/update automatically triggers a fresh ResetDistributionCache call, or click "Clear CDN Cache Now" to purge it immediately.
This plugin exists specifically to answer that question — it's a purpose-built Lightsail CDN cache manager, not a repurposed CloudFront or generic multi-CDN plugin. It talks directly to the Lightsail ResetDistributionCache API using AWS Signature Version 4.
The plugin's own admin actions run through WordPress's authenticated AJAX/REST layer with capability checks, and cache-clear triggers fire correctly for content changes made via the REST API (e.g. from the block editor or headless front ends), not just classic post saves.
wp bcs-lsm flushbytepresstech-cdn-manager-for-lightsail) and all your settings are unchanged@import in admin.css); it now uses the system font stack instead, removing an external request that was previously made on every visit to the settings page