- Automatically purge Cloudflare cache when media saved
- Purge by prefix (Cloudflare Pro & Enterprise)
- Purge all (All Cloudflare plans)
- Adds cache headers when serving media
- Respects image cropper
dotnet add package jcdcdev.Umbraco.CloudflareMediaCache
You will need a Cloudflare Zone ID and API Key to use this package.
- Zone ID: Find your Zone ID
- API Key: Create an API Key
Note: The API Key should have the following permission:
- Zone.Cache Purge
Add the following section to your appsettings.json
:
{
"Cloudflare": {
"Media": {
"Cache": {
"ZoneId": "ZONE_ID",
"ApiToken": "API_TOKEN",
"Enabled": true,
"Mode": "All",
"MaxAge": 2592000
}
}
}
}
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) |
Contributions to this package are most welcome! Please read the Contributing Guidelines.
- LottePitcher - opinionated-package-starter
- jcdcdev - jcdcdev.Umbraco.PackageTemplate