moritzebeling / kirby-cachebusting
Kirby Cachebusting plugin
Installs: 43
Dependents: 0
Suggesters: 0
Security: 0
Stars: 5
Watchers: 2
Forks: 0
Open Issues: 0
Type:kirby-plugin
Requires
- php: >=7.4.0
- getkirby/composer-installer: ^1.1
This package is auto-updated.
Last update: 2024-10-31 00:25:40 UTC
README
⚠️ This is taken from the Kirby website and source code and only here to simplify installation for myself via composer. Please check:
- 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
The plugin adds a fingerprint like file.css?v=12345678
to every file added from the /assets
folder using Kirbys helper methods like css()
or js()
.
Via the options you can also provide a custom host if you want to host your assets on some CDN,
Installation
composer require moritzebeling/kirby-cachebusting composer update moritzebeling/kirby-cachebusting
Or download/clone this repo into site/plugins
of your Kirby project.
Config
# 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 // ... ];
Usage
Just use the css()
and js()
helper methods to include your styles and scripts.
Development
- Install a fresh Kirby StarterKit
cd site/plugins
git clone
this repo
Support
If you have any ideas for further development or stumble upon any problems, please open an issue or PR. Thank you!
Warranty
This plugin is work in progress and comes without any warranty. Use at your own risk.