Cloudflare Media Cache

Automatically purge Cloudflare cache

Docs Quickstart Umbraco Marketplace License NuGet Downloads

Features

Automatic

Simply configure your Zone ID and API Token!

Caching

Adds an ETag for all media requests with full Image Cropper query string support. 

Purge Modes

  • All - Purges the entire cache (All Cloudflare plans)
  • Prefix - Purges the media item (Cloudflare Pro & Enterprise)

Versions

Umbraco icon
Umbraco CMS 10

10.0.4

Version 10 Support Policy

Feature updates ended 16/06/2024
Security updates until 16/06/2025
Umbraco icon
Umbraco CMS 13

13.0.3

Version 13 Support Policy

Feature updates until 14/12/2025
Security updates until 14/12/2026
Umbraco icon
Umbraco CMS 14

14.0.4

Version 14 Support Policy

Feature updates ended 02/03/2025
Security updates until 30/05/2025
Umbraco icon
Umbraco CMS 15

15.0.1

Version 15 Support Policy

Feature updates until 14/08/2025
Security updates until 14/11/2025

Readme

Quick Start

Install Package

dotnet add package jcdcdev.Umbraco.CloudflareMediaCache

Get Cloudflare Zone ID & API Key

You will need a Cloudflare Zone ID and API Key to use this package.

Note: The API Key should have the following permission:

  • Zone.Cache Purge

Configuration

Add the following section to your appsettings.json:

{
"Cloudflare": {
"Media": {
"Cache": {
"ZoneId": "ZONE_ID",
"ApiToken": "API_TOKEN",
"Enabled": true,
"Mode": "All",
"MaxAge": 2592000
}
}
}
}

Options

Option Description
ZoneId The Cloudflare Zone ID
Key The Cloudflare API Key
Enabled Whether to enable functionality
Mode The cache mode (All, Prefix)
MaxAge The max-age for cache headers (seconds)

Contributing

Contributions to this package are most welcome! Please visit the Contributing page.

Acknowledgements (Thanks)