kenshodigital/kirby-cloudflare-cache
Composer 安装命令:
composer require kenshodigital/kirby-cloudflare-cache
包简介
Provides Cloudflare Cache integration for Kirby projects.
关键字:
README 文档
README
Provides Cloudflare Cache integration for Kirby projects.
General
If you’re proxying a website through Cloudflare, static assets are already cached in most cases. HTML pages aren’t cached by default, though. While this can be easily enabled with a basic Cache Rule in Cloudflare, the CDN has no way to tell what pages are actually considered cacheable by Kirby’s standards, or when content has been updated in the CMS. It simply caches every page until the cache gets manually purged again or expires.
The plugin provides a custom cache driver intended to be used for Kirby’s page cache. This leverages Kirby’s core logic for determining what pages are cacheable and when to flush the cache. Instead of actually caching a page on the file system or in some key-value store, the cache driver only sends the appropriate Cloudflare headers, and leaves the caching itself to the CDN.
It also takes care of purging the cache via API when appropriate, making the overall caching behavior consistent with Kirby’s built-in page cache.
Further reading
Usage
Installation
composer require kenshodigital/kirby-cloudflare-cache ^1.0
Setup
Cloudflare
As mentioned, the domain has to be proxied through Cloudflare and a cache rule needs to be set up to actually cache all eligible responses, including HTML pages.
An API token with Cache Purge permission for the domain is also required.
Further reading
Kirby
In your config.php, make sure to enable the page cache, set the cache type to cloudflare, and provide your zone ID along with your API token.
<?php declare(strict_types=1); return [ 'cache' => [ 'pages' => [ 'active' => true, 'type' => 'cloudflare', 'zone' => '***', 'token' => '***', ], ], ];
Further reading
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-07-01