LiteSpeed Cache for Flarum

A unofficial Flarum extension. Integrates LSCache with your forum.
Requires a LiteSpeed Web Server or OpenLiteSpeed.
A public cache is currently available. A cache for logged in is planned, but it will be difficult.
This extension has just been created and still needs a lot of work. Feel free to contribute.
Installation
Install with composer:
composer require acpl/flarum-lscache:"*"
You need to include this code in your .htaccess
file:
<IfModule LiteSpeed>
CacheLookup on
</IfModule>
You can also add your own rules. For more information see here: https://docs.litespeedtech.com/lscache/noplugin/settings/#rewrite-rules
Updating
composer update acpl/flarum-lscache:"*"
php flarum migrate
php flarum cache:clear
When you clear the Flarum cache, the LSCache is cleared automatically. Unless you disable it in the settings.
You can clear LSCache without clearing the Flarum cache in the admin panel. The option is available under the standard Flarum cache clearing option. There is also the php flarum lscache:clear
command. The command supports the --path
argument. E.g. php flarum lscache:clear --path=/tags --path=/d/1-test
. You can use it if you want to purge only specific paths instead of the entire cache.
FAQ
How do I avoid generating different cache versions for specific query strings? E.g. fbclid.
You can use CacheKeyModify -qs:[key]
.
Example:
<IfModule LiteSpeed>
CacheLookup on
CacheKeyModify -qs:fbclid
CacheKeyModify -qs:gclid
CacheKeyModify -qs:utm*
CacheKeyModify -qs:_ga
</IfModule>
Links