Linux 软件免费装
Banner图

Oh My Cache!

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

标签

cache cdn cloudflare redis nginx

下载

1.0.0

详情介绍:

Clears the page cache on your own server first, then the copy Cloudflare holds at the edge. One plugin, one list of URLs, so the two cannot disagree about what was cleared.

安装:

  1. Upload the plugin and activate it.
  2. Follow the wizard. It detects your NGINX cache folder and Redis, then connects Cloudflare.
  3. The last step runs a real purge and tells you whether it worked.
Keeping your Cloudflare token out of the database Add this to wp-config.php: define( 'OH_MY_CACHE_CF_API_TOKEN', 'your-token' ); or set OH_MY_CACHE_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. If DISABLE_WP_CRON is set Queued retries need something to run them: * * * * * wp oh-my-cache queue run --all --quiet Without a cron entry, anything that falls back to the queue never runs. The dashboard warns you when that happens.

常见问题:

Does it need the Redis extension?

Only if you turn the Redis driver on. It needs phpredis 6.0 or newer and does not bundle a pure-PHP replacement. When phpredis is missing, the driver says so instead of failing quietly.

How long can a queued purge take?

Up to about a minute. WordPress will not spawn cron more than once every 60 seconds, so a queued job is never instant. Local cache clearing always runs immediately for that reason; only Cloudflare gets deferred.

Which sitemaps does it clear?

Whichever your site publishes. Core, Yoast SEO, Rank Math, All in One SEO and SEOPress are detected, and the index is read twice a day for the file names, so a news sitemap, a taxonomy one or page two of a paginated one need no configuring. Editing a post clears its post type's files, its taxonomies, the author file and the news sitemap, and leaves the other types alone. The dashboard lists what was found. For anything undetected, put its index URL in the paths field under When to purge, or use the oh_my_cache_sitemap_urls filter.

Does it work with WooCommerce?

Yes. WooCommerce writes stock, prices and variations straight to the database without saving the post, so the plugin listens to WooCommerce's own hooks: a price change or the last item selling out clears the product page, the shop page and the category archives. The cart, checkout and account pages never reach the edge, and neither do cart fragments. Twice over: the origin refuses to mark them cacheable, and the Cloudflare rule excludes their paths, taken from your store's settings rather than the English defaults.

Is it safe to cache HTML at the edge?

Only once clearing demonstrably works, which is why the wizard refuses a non-zero edge TTL until a test purge has actually succeeded. Pages held at the edge while clearing is broken stay stale for the whole TTL, and a visitor cannot get past them.

更新日志:

1.0.0