Download the PHP package bnomei/kirby3-staticache without Composer
On this page you can find all versions of the php package bnomei/kirby3-staticache. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download bnomei/kirby3-staticache
More information about bnomei/kirby3-staticache
Files in bnomei/kirby3-staticache
Package kirby3-staticache
Short Description Kirby 3 plugin to cache html output statically on demand with headers
License MIT
Homepage https://getkirby.com/plugins/getkirby/staticache
Informations about the package kirby3-staticache
ARCHIVED since v1.0.0 of official plugin was released on 1/17/23
Kirby3 Staticache
Kirby 3 plugin to cache html output statically on demand with headers
Commercial Usage
Support open source!
This plugin is free but if you use it in a commercial project please consider to sponsor me or make a donation.
If my work helped you to make some cash it seems fair to me that I might get a little reward as well, right?
Be kind. Share a little. Thanks.
‐ Bruno
M | O | N | E | Y |
---|---|---|---|---|
Github sponsor | Patreon | Buy Me a Coffee | Paypal dontation | Hire me |
Installation
- unzip master.zip as folder
site/plugins/kirby3-staticache
or git submodule add https://github.com/bnomei/kirby3-staticache.git site/plugins/kirby3-staticache
orcomposer require bnomei/kirby3-staticache
Setup Cache
Cache configuration
Staticache is a cache driver that can be activated for the page cache.
site/config/config.php
You can also use the cache ignore rules to skip pages that should not be cached.
site/config/config.php
Cache duration
Kirby will automatically purge the cache when changes are made in the Panel.
Setup Server
You can use any of the following ways to make the static cache load. Using one of the native server config rules will be a tiny bit faster than PHP. But if you need to preserve the headers sent using PHP is the only easy way to do it.
PHP
If you installed the plugin with composer you can use a helper method called staticache()
.
index.php
Otherwise you need to add these lines before your kirby render method.
index.php
Apache htaccess rules
Add the following lines to your Kirby htaccess file, directly after the RewriteBase rule.
Nginx
Standard php nginx config will have this location block for all requests
change it to add /static/$uri/index.html
before last /index.php
fallback.
Settings
bnomei.staticache. | Default | Description |
---|---|---|
root | function(){...} |
callback to set the root |
message | function(){...} |
callback to return a message appended to html output |
Disclaimer
This plugin is provided "as is" with no guarantee. Use it at your own risk and always test it yourself before using it in a production environment. If you find any issues, please create a new issue.
License
It is discouraged to use this plugin in any project that promotes racism, sexism, homophobia, animal abuse, violence or any other form of hate speech.
Credits
- based on the idea by Bastian Allgeier
- extended version by Bruno Meilick