PHPackages                             litespeedtech/lscache-drupal - 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. litespeedtech/lscache-drupal

ActiveDrupal-module[Caching](/categories/caching)

litespeedtech/lscache-drupal
============================

Page Cache for LiteSpeed Web Server. Caches pages for any user, handling dynamic content correctly.

v1.6(1y ago)153.1k↓22.5%19[14 issues](https://github.com/litespeedtech/lscache-drupal/issues)[1 PRs](https://github.com/litespeedtech/lscache-drupal/pulls)1GPL-3.0-onlyPHP

Since Aug 28Pushed 2w ago7 watchersCompare

[ Source](https://github.com/litespeedtech/lscache-drupal)[ Packagist](https://packagist.org/packages/litespeedtech/lscache-drupal)[ Docs](https://www.litespeedtech.com/products/cache-plugins)[ RSS](/packages/litespeedtech-lscache-drupal/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (8)DependenciesVersions (8)Used By (1)

LiteSpeed Cache for Drupal 8+
=============================

[](#litespeed-cache-for-drupal-8)

- Fastest Page cache for Drupal CMS.
- Page Cache for both Logged In and Logged Out users.
- Auto Purge relate Page Caches when content changes.
- Drush and non-Drush cli commands for Cache warmup/clear.
- Web GUI warmup will also warm up **Private Cache for Logged In Users** if enabled.
- Supports latest releases of Drupal 8+, 9+, 10+ and 11+ .

See [the LiteSpeed Website](https://www.litespeedtech.com/products/cache-plugins/drupal-acceleration) for more information about LiteSpeed Cache for Drupal.

See [the full documentation](https://docs.litespeedtech.com/lscache/lscdrupal/) for more installation and configuration help.

Prerequisites
-------------

[](#prerequisites)

This version of LiteSpeed Cache requires Drupal 8 or later and LiteSpeed Web Server (LSWS) 5.2.3 or later.

Download
--------

[](#download)

Download the LiteSpeed Cache Module to your local computer from:

```
https://github.com/litespeedtech/lscache-drupal/archive/master.zip

```

 Click to show details[![Plugin Installation picture](/images/DrupalPluginInstall.gif)](/images/DrupalPluginInstall.gif)

If you use Composer to manage dependencies or using Drupal 11+, using the following command to download:

```
composer require litespeedtech/lscache-drupal

```

Install Plugin
--------------

[](#install-plugin)

Once you have downloaded the plugin, you can install by visiting:

```
http://example.com/admin/modules/install

```

Using the browse button, you can upload the plugin you just downloaded and start the installation. Once installed, enable the plugin by going to:

```
http://example.com/drupal/admin/modules

```

 Click to show details[![Plugin Installation picture](/images/DrupalPluginEnable.gif)](/images/DrupalPluginEnable.gif)

- Use the search box to search for a module.
- Check the checkbox next to **LiteSpeed Cache**.
- Click **Install**.
- Turn on LiteSpeed Cache in **Module Settings**.

Configuration
-------------

[](#configuration)

This step is optional. Once the plugin is activated, your cache is already up and running, but on the configuration screen, you can customize few settings.

Go to

```
http://example.com/admin/config/development/lscache

```

[![LiteSpeed Cache Drupal Plugin Configuration](https://camo.githubusercontent.com/df42f76932fc278d868ba7218727745e9e2a4268883f09b21fb7c6594c5d7886/68747470733a2f2f646f63732e6c6974657370656564746563682e636f6d2f696d67732f6c7363616368652f6c736364727570616c2f636f6e6669677572652d6c7363616368652e706e67)](https://camo.githubusercontent.com/df42f76932fc278d868ba7218727745e9e2a4268883f09b21fb7c6594c5d7886/68747470733a2f2f646f63732e6c6974657370656564746563682e636f6d2f696d67732f6c7363616368652f6c736364727570616c2f636f6e6669677572652d6c7363616368652e706e67)

- **Warmup this site**: Warm up the LSCache of the current Drupal site. It will also warm up **Private Cache for Logged In Users** if enabled.
- **Clear this site**: Clears the LSCache of the current Drupal site. It will not clear the LSCache of other sites if you have multiple CMS sites running on the same virtual host.
- **Public Cache TTL**: Amount of time LiteSpeed Web Server will save pages in the public cache.
- **Private Cache TTL**: Amount of time LiteSpeed web server will save **ESI Block Contents** in the Private cache. OpenLiteSpeed does not support Private Cache.
- **ESI Blocks Setting**: The list of ESI blocks on general logged in pages. The ESI Block name should be the same as the `div id` inside the HTML source. For example, in the following `div` block, the ESI Block name would be `bar-administrator`: ```
     ...

    ```
- **Debug**: If turned on, LiteSpeed Cache will print the LSCache header to LSWS log files.

Drupal Cache API support
------------------------

[](#drupal-cache-api-support)

Now it support to use Drupal Cache API as the following example:

```
use Drupal\lite_speed_cache\Cache\LSCacheBackend;

class LSCacheController extends ControllerBase {
  public function litedemo() {
    $cacheInstance = new LSCacheBackend();
    //$cacheInstance->purgeAllPublic();
    $cacheInstance->invalidate('product:1');
    //$cacheInstance->purgeAllPrivate();
    //$cacheInstance->invalidatePrivate('product:1');

    $response = new CacheableResponse('Hello, LiteSpeed! ' . date("d/m/Y H:i:s"));
    $cacheMeta = $response->getCacheableMetadata();
    $cacheMeta->setCacheMaxAge(3688);
    $cacheMeta->setCacheTags(['product:1']);

    //use this function to cache whole page output privately, not recommend, only use it for web APIs for logged-in user
    //$cacheMeta->addCacheContexts(['user.roles:anonymous']);
    return $response;
  }
}

```

CLI commands
------------

[](#cli-commands)

CLI commands are only allowed to execute from the website host server.

**Purge All Cache**

```
curl -N "http://example.com/lscpurgeall"

```

or in `/drupal_root/vendor/bin` folder, execute `drush` command:

```
./drush lscache:purgeall example.com

```

**WarmUp whole website**

```
curl -N "http://example.com/lscwarmup"

```

or in `/drupal_root/vendor/bin` folder, execute `drush` command:

```
./drush lscache:warmup example.com

```

**WarmUp XML sitemap**

in `/drupal_root/vendor/bin` folder, execute `drush` command:

```
./drush lscache:warmup http://example.com/sitemap.xml

```

CLI `warmup` command can only warm up public page caches. If you want to warm up **Private Cache for Logged In Users**, you need to use the Web GUI warmup in the LSCache admin panel.

###  Health Score

45

—

FairBetter than 91% of packages

Maintenance51

Moderate activity, may be stable

Popularity34

Limited adoption so far

Community24

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 64.2% 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 ~306 days

Recently: every ~222 days

Total

6

Last Release

604d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6320dbf83c1b55b0ec4fd30f2dee1b85450d7e9e4f273df270e7ec87cab9de8b?d=identicon)[wchen](/maintainers/wchen)

---

Top Contributors

[![WuhuaChen](https://avatars.githubusercontent.com/u/34863158?v=4)](https://github.com/WuhuaChen "WuhuaChen (70 commits)")[![wadedang](https://avatars.githubusercontent.com/u/1653912?v=4)](https://github.com/wadedang "wadedang (14 commits)")[![litespeedtech](https://avatars.githubusercontent.com/u/4990456?v=4)](https://github.com/litespeedtech "litespeedtech (12 commits)")[![Woet](https://avatars.githubusercontent.com/u/3000589?v=4)](https://github.com/Woet "Woet (4 commits)")[![saschaeggi](https://avatars.githubusercontent.com/u/5558166?v=4)](https://github.com/saschaeggi "saschaeggi (3 commits)")[![Code-Egg](https://avatars.githubusercontent.com/u/17311438?v=4)](https://github.com/Code-Egg "Code-Egg (3 commits)")[![jefflogan303](https://avatars.githubusercontent.com/u/10466245?v=4)](https://github.com/jefflogan303 "jefflogan303 (2 commits)")[![lslisa](https://avatars.githubusercontent.com/u/31540022?v=4)](https://github.com/lslisa "lslisa (1 commits)")

---

Tags

drupalcachelitespeed

### Embed Badge

![Health badge](/badges/litespeedtech-lscache-drupal/health.svg)

```
[![Health](https://phpackages.com/badges/litespeedtech-lscache-drupal/health.svg)](https://phpackages.com/packages/litespeedtech-lscache-drupal)
```

###  Alternatives

[psr/simple-cache

Common interfaces for simple caching

8.1k772.9M2.7k](/packages/psr-simple-cache)[psr/cache

Common interface for caching libraries

5.2k726.4M1.7k](/packages/psr-cache)[react/cache

Async, Promise-based cache interface for ReactPHP

445131.2M46](/packages/react-cache)[beste/in-memory-cache

A PSR-6 In-Memory cache that can be used as a fallback implementation and/or in tests.

2515.9M12](/packages/beste-in-memory-cache)[fastd/fastd

A High Performance API Framework By Swoole Extension

42015.5k18](/packages/fastd-fastd)[anahkiasen/flatten

A package for the Illuminate framework that flattens pages to plain HTML

33313.0k](/packages/anahkiasen-flatten)

PHPackages © 2026

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