HomeBlogProjectsAbout
© 2020-2025 Notes of Dev.
This content is licensed under CC BY 4.0
— May 6, 2025

Payload Purge Cache Plugin v0.1.1

Granular Cloudflare purge support and runtime purger control now available in v0.1.1.

Payload Purge Cache Plugin v0.1.1 introduces more detailed configuration for the Cloudflare purger and lets you skip specific purgers when needed.

New Features

Granular Cloudflare Purger Config

On April 1st, Cloudflare announced that all purge methods are now available for every plan. Just a few days later, the initial version of the Purge Cache Plugin was released. Starting with version v0.1.1, you can now specify which hosts, tags, prefixes, and full URLs to purge.

# typescript
Copied
getCloudflarePurgerAction({
  apiKey: '...',
  zoneId: '...',
  hosts: ['notesofdev.com'],
})

You can set multiple options at once. For example, if you define a host, tags, and a prefix, the plugin will purge all three individually.

Here are the new options you can use in the purger config:

  • hosts?: string[] - Optional list of hosts to purge
  • tags?: string[] - Optional list of tags to purge
  • prefixes?: string[] - Optional list of prefixes to purge. A prefix has to include hostname but not scheme (e.g.: example.com/prefix)
  • files?: string[] - Optional list of specific urls to purge. An url has to include scheme, hostname and path (e.g.: https://example.com/full/path)

Skip Specific Purgers

Sometimes, you may want to purge just one part of the cache. For example, if you have a purger that handles all links starting with /blog, you can now run only that purger and skip the rest:

Purger selector

Bug Fixes and Maintenance

This version also includes three minor fixes:

  • Added error message for invalid Cloudflare config - previously, if the Cloudflare configuration was incorrect, no error was shown, leaving the user with stale cache.
  • Removed default error type in PurgerAction - the error type is already inherited from the Purger config. Keeping a default caused false-positive type errors.
  • Added missing styles - Minor visual updates.
  • payloadcms
  • open source

Related posts

— Mar 11, 2025

TypeScript Announces Rewrite in Go

— Mar 10, 2025

My optimal ESLint setup

— Feb 19, 2025

Using Radix Colors with Tailwind CSS

— Feb 5, 2025

Sticky Auto-Hiding Header with JS (or React)

— Dec 1, 2023

Self-invoking AWS Lambda using API Gateway