Download the PHP package soderlind/cache-tags-for-cloudflare without Composer

On this page you can find all versions of the php package soderlind/cache-tags-for-cloudflare. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package cache-tags-for-cloudflare

Cache Tags for Cloudflare

Precise Cloudflare cache purging for WordPress: adds Cache-Tag headers and purges only affected posts, pages, and terms.

WP-CLI

What it does

The plugin has two independently toggleable parts:

Context Responsibility
Tagging Emits a Cache-Tag response header on singular posts/pages/CPTs.
Purging Calls the Cloudflare API to invalidate the affected tags when content changes.

See docs/adr/ for the key architectural decisions.

Default tags

For singular content:

Example: Cache-Tag: content,b1,b1-p42,b1-pt-post,b1-t5

Term tags use the numeric term ID (b1-t5), so they stay stable when a term is renamed or its slug changes.

Installation

  1. Install the plugin using one of:

    • WordPress.org — install directly from the plugin directory via Plugins → Add New and search for "Cache Tags for Cloudflare".
    • Release zip — download the latest cache-tags-for-cloudflare.zip from the Releases page and upload it via Plugins → Add New → Upload Plugin.
    • Composer — for Composer-managed WordPress sites (Bedrock, etc.). The wordpress-plugin type installs it into your plugins directory automatically (via composer/installers):

      The plugin has no runtime dependencies and ships its compiled build/ assets, so no build step is needed. If it isn't on Packagist yet, add the repository first:

    • Git checkout — clone into wp-content/plugins/ (the compiled build/ assets are committed, so no build step is required):
  2. Activate Cache Tags for Cloudflare on the Plugins screen (or network-activate on multisite).
  3. Add your Cloudflare API token and Zone ID — via wp-config.php constants or under Settings → Cache Tags (see Configuration).

Configuration

Provide a scoped Cloudflare API token (Zone → Cache Purge) and a Zone ID. Constants in wp-config.php are preferred and take precedence over the settings UI:

Otherwise configure them under Settings → Cache Tags (see Admin UI below). Saving valid credentials automatically verifies the Cloudflare connection and unlocks the purge tools.

Admin UI

Settings → Cache Tags is a React app (@wordpress/components) with two tabs:

Automatic purging

When Auto-purge on changes is enabled (and valid credentials are set), the plugin purges the affected tags automatically on these events:

Event Purges
Post published, updated, trashed, or untrashed (any transition to or from the published status) b{id}-p{ID} + the post's b{id}-t{term_id} tags
Post published (draft/scheduled going live, or any save while published) the post's permalink, purged by URL
Post permanently deleted b{id}-p{ID} + its b{id}-t{term_id} tags
Taxonomy term edited or deleted b{id}-t{term_id}

Details:

Extensibility

The plugin exposes hooks for customizing tags and purging from your own code:

See the Developer guide for full documentation and examples.

WP-CLI

On multisite, --all (and the everything group / purge_all hook) purge only the current subsite via its b{id} tag. To purge every site sharing the Cloudflare zone at once, purge the global content tag directly: wp cache-tags purge --tags=content.

External services

This plugin connects to the Cloudflare API (https://api.cloudflare.com) to verify your credentials and to purge cached content by cache tag. Cloudflare is required for the purging feature; the tagging feature (emitting Cache-Tag headers) works without contacting any external service.

Requests are made only after you provide a Cloudflare API token and Zone ID:

Cloudflare is a third-party service provided by Cloudflare, Inc. By using the purging feature you agree to Cloudflare's Terms of Service and Privacy Policy.

Development

Build tooling, hooks, programmatic purging, and how to test purging (including without a public site) are documented in the Developer guide.

License

GPL-2.0-or-later.


All versions of cache-tags-for-cloudflare with dependencies

PHP Build Version
Package Version
Requires php Version >=8.3
composer/installers Version ^1.12 || ^2.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package soderlind/cache-tags-for-cloudflare contains the following files

Loading the files please wait ...