PHPackages                             oskar-koli/kirby-litespeed - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Caching](/categories/caching)
4. /
5. oskar-koli/kirby-litespeed

ActiveKirby-plugin[Caching](/categories/caching)

oskar-koli/kirby-litespeed
==========================

Litespeed cache plugin for Kirby CMS

0.1.4(6mo ago)4115↓33.3%MITPHP

Since Sep 19Pushed 6mo agoCompare

[ Source](https://github.com/oskar-koli/kirby-litespeed)[ Packagist](https://packagist.org/packages/oskar-koli/kirby-litespeed)[ RSS](/packages/oskar-koli-kirby-litespeed/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (2)Versions (6)Used By (0)

Kirby Litespeed Plugin
======================

[](#kirby-litespeed-plugin)

[![Packagist Version](https://camo.githubusercontent.com/79f7542ed1213b188620ce3a40721756f766d250049f250321074a078b43811b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6f736b61722d6b6f6c692f6b697262792d6c6974657370656564)](https://packagist.org/packages/oskar-koli/kirby-litespeed)

A Kirby CMS plugin which adds support for caching pages using Litespeed's LSCache.

Kirby's built in caching still requires Kirby to boot for the cached pages to be returned, which results in even cached requests usually taking at least 150ms on shared hosting. Using this plugin Kirby doesn't have to be booted when a cached page is hit, resulting in 70ms or faster response times.

Installation &amp; Configuration
--------------------------------

[](#installation--configuration)

### Requirements

[](#requirements)

- Kirby CMS ^5
- Litespeed server (The site will still work without a Litespeed server, but then this plugin does nothing)

### Installation

[](#installation)

```
composer require oskar-koli/kirby-litespeed
```

### Configuration

[](#configuration)

```
// site/config/config.php
'cache' => [
    'pages' => [
        'type' => 'litespeed',
        'active' => true,

        // Optional:

        // Controls if page should be cached
        'ignore' => fn ($page) => $page->title()->value() === 'Do not cache me',

        // Controls how long Litespeed caches the page (in seconds)
        // The default duration is 2 days (172800 seconds)
        'duration' => fn ($page) => $page->slug() == 'slug' ? 172800 : 600
    ]
]
```

> **Note:** The Litespeed cache can only be used for pages and will *not* work as the driver for any other kind of cache.

Caching &amp; Purging Logic
---------------------------

[](#caching--purging-logic)

LSCache's public cache is the only one used, the private cache is not supported.

A page is cached following the same rules as described in [Kirby's documentation.](https://getkirby.com/docs/guide/cache#caching-pages__automatic-cacheability-detection)

The cache is purged when

- Kirby requests a purge, e.g. when any edits are made in the Panel (this causes a full purge)
- When Litespeed decides to purge a cache, e.g. when the max-age has been reached.

.htaccess Configuration
-----------------------

[](#htaccess-configuration)

The plugin does not modify the `.htaccess` automatically. You need to enable Litespeed caching manually by for example adding the following configuration:

```

    RewriteEngine on
    CacheLookup on
    RewriteRule .* - [E=Cache-Control:no-autoflush]

    # Ignore some common query parameters
    CacheKeyModify -qs:fbclid
    CacheKeyModify -qs:gclid
    CacheKeyModify -qs:utm*
    CacheKeyModify -qs:_ga

```

CLI Cache Purging
-----------------

[](#cli-cache-purging)

You can manually clear the cache using Kirby CLI:

```
kirby clear:cache pages
```

This works by making an HTTP request to a route on the website which triggers the Litespeed server to purge the cache.

For CLI purging to work, you need to define a purge token in your `config.php`:

```
// Token used to authenticate the REST call which purges the cache
'oskar-koli.kirby-litespeed.purge-token' => 'your-secure-token-here'
```

You can for example generate the token by running `openssl rand -hex 32`.

Additionally, the plugin needs to know the URL of your site. You have three options:

#### Option 1: Plugin specific option

[](#option-1-plugin-specific-option)

```
'oskar-koli.kirby-litespeed.site-url' => 'https://example.com'
```

#### Option 2: Environment variable

[](#option-2-environment-variable)

```
LITESPEED_SITE_URL="https://example.com" kirby clear:cache pages
```

#### Option 3: Kirby's URL option

[](#option-3-kirbys-url-option)

If none of these are set, the plugin will fall back to `site()->url()`.
For this to work in CLI, the `url` option has to be set:

```
'url' => 'https://example.com'
```

Is the plugin production ready?
-------------------------------

[](#is-the-plugin-production-ready)

The plugin is in use in production on a couple smaller websites and everything is working smoothly. That being said, there might still be some edge cases that which might cause issues on more complex websites. Please submit a bug report if you face any issues!

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance66

Regular maintenance activity

Popularity16

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity29

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~7 days

Total

5

Last Release

208d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5511708?v=4)[Oskar Koli](/maintainers/oskar-koli)[@oskar-koli](https://github.com/oskar-koli)

---

Top Contributors

[![oskar-koli](https://avatars.githubusercontent.com/u/5511708?v=4)](https://github.com/oskar-koli "oskar-koli (20 commits)")

### Embed Badge

![Health badge](/badges/oskar-koli-kirby-litespeed/health.svg)

```
[![Health](https://phpackages.com/badges/oskar-koli-kirby-litespeed/health.svg)](https://phpackages.com/packages/oskar-koli-kirby-litespeed)
```

###  Alternatives

[predis/predis

A flexible and feature-complete Redis/Valkey client for PHP.

7.8k305.7M2.4k](/packages/predis-predis)[snc/redis-bundle

A Redis bundle for Symfony

1.0k39.4M67](/packages/snc-redis-bundle)[react/cache

Async, Promise-based cache interface for ReactPHP

444112.4M40](/packages/react-cache)[illuminate/cache

The Illuminate Cache package.

12835.6M1.4k](/packages/illuminate-cache)[colinmollenhour/php-redis-session-abstract

A Redis-based session handler with optimistic locking

6325.6M14](/packages/colinmollenhour-php-redis-session-abstract)[amphp/redis

Efficient asynchronous communication with Redis servers, enabling scalable and responsive data storage and retrieval.

165634.7k44](/packages/amphp-redis)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
