moritzebeling / kirby-cachebusting
Kirby 缓存清理插件
2.0.1
2023-06-02 00:00 UTC
Requires
- php: >=7.4.0
- getkirby/composer-installer: ^1.1
This package is auto-updated.
Last update: 2024-08-31 00:37:08 UTC
README
⚠️ 此内容来自 Kirby 网站 和 源代码,仅在此处用于简化通过 composer 的安装。请检查
- https://getkirby.com/docs/cookbook/extensions/kirby-loves-cdn#cache-busting
- https://github.com/getkirby/getkirby.com/blob/main/site/plugins/cdn/src/Cachebuster.php
该插件为从“/assets”文件夹通过 Kirby 的辅助方法(如 css()
或 js()
)添加的每个文件添加一个指纹,例如 file.css?v=12345678
。
通过选项,您还可以提供自定义主机,如果您想在某个 CDN 上托管您的资产。
安装
composer require moritzebeling/kirby-cachebusting composer update moritzebeling/kirby-cachebusting
或将此仓库下载/克隆到您的 Kirby 项目的 site/plugins
目录中。
配置
# site/config/config.php return [ 'moritzebeling.kirby-cachebusting' => false // to switch off completely, 'moritzebeling.kirby-cachebusting.host' => 'https://remote-host.com', // to set remote host, like cdn // ... ];
使用方法
只需使用 css()
和 js()
辅助方法来包含您的样式和脚本。
开发
- 安装一个全新的 Kirby StarterKit
cd site/plugins
git clone
此仓库
支持
如果您有任何进一步开发的想法或遇到任何问题,请打开一个 issue 或 PR。谢谢!
保修
此插件处于开发中,不提供任何保修。自行承担风险使用。