Linux 软件免费装
Banner图

ClassicFlare

开发者 butialabs
更新时间 2026年10月30日 02:59
PHP版本: 8.1 及以上
WordPress版本: 7.1
版权: GPLv3 or later
版权网址: 版权信息

标签

cache classicpress cdn cloudflare purge

下载

1.0.0

详情介绍:

ClassicFlare does one thing: it keeps the copy of your site that Cloudflare holds at the edge in step with your content. Publish, update or trash a post, approve a comment, and the pages that changed are purged from Cloudflare, along with every page that shows them. It does not change anything in your Cloudflare zone: no cache rules, no zone settings, no page rules. It only ever asks Cloudflare to forget cached files. ClassicFlare is built for ClassicPress 2 and works the same on WordPress. It is not affiliated with or endorsed by Cloudflare, Inc. or the ClassicPress project.

安装:

  1. Upload the plugin and activate it.
  2. In Cloudflare, go to My Profile, API Tokens, Create Token, and create a custom token with two permissions, limited to your site's zone: Zone → Zone → Read and Zone → Cache Purge → Purge.
  3. Go to Settings → ClassicFlare, paste the token and press Connect. The plugin checks the token, finds the zone for your domain and is ready.
Keeping the token out of the database Add this to wp-config.php: define( 'CLASSICFLARE_CF_API_TOKEN', 'your-token' ); or set CLASSICFLARE_CF_API_TOKEN in the environment. The token is then never written to the database, so it stays out of backups and staging copies, and the settings screen stops offering a field for it. CLASSICFLARE_CF_ZONE_ID does the same for the zone, skipping discovery. CLASSICFLARE_DISABLE set to true switches automatic purging off, for a staging copy that shares the production token.

常见问题:

Does it work on ClassicPress?

Yes. It is written for ClassicPress 2 and needs nothing from the block editor. On WordPress it also catches block editor saves, after categories and tags have been written.

Why a token and not my Global API Key?

The Global API Key can do anything to every zone in your account and cannot be limited. A token can be limited to purging the cache of one zone, and revoked on its own.

A visitor's comment did not clear the page straight away

Comments posted from the front end are purged a few seconds later, on WP-Cron, so the visitor does not wait on a call to Cloudflare. If your site sets DISABLE_WP_CRON, make sure a system cron calls wp cron event run --due-now every minute.

Cloudflare says some URLs are "not in this zone"

The hostname in your site address is not proxied by Cloudflare (grey cloud), or belongs to another zone. Those URLs are reported as skipped, not failed, and are not retried.

Which WP-CLI commands are there?

  • wp classicflare purge <url>...
  • wp classicflare post <id> [--dry-run]
  • wp classicflare purge-all [--yes]
  • wp classicflare connect [<token>]
  • wp classicflare test
  • wp classicflare status

Can other plugins trigger a purge?

Yes, through functions or actions that do nothing if ClassicFlare is not installed: do_action( 'classicflare_purge_url', [ 'https://example.com/page/' ] ); do_action( 'classicflare_purge_post', $post_id ); do_action( 'classicflare_purge_all' ); The classicflare_purge_urls filter adjusts the final list before it is sent, and classicflare_sitemap_urls teaches it about a sitemap generator it does not know.

更新日志:

1.0.0