atomicptr / typo3-lscache

LiteSpeed Cache extension for TYPO3

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

typo3-lscache

LiteSpeed Cache extension for TYPO3.

Install via composer

$ composer require atomicptr/lscache

Configuration

Put this inside your .htaccess

<IfModule LiteSpeed>
  CacheLookup public on
</IfModule>

Signals & Slots

This extension has a few slots you can connect to:

Class: \Atomicptr\Lscache\Service\LscacheService

cacheResponseHeaders

<?php
// ...
class CacheResponseHeaderSlot {
    public function handle(LscacheService $lscacheService) {
        $lscacheService->headers = []; // remove headers
    }
}

cacheTags

<?php
// ...
class CacheTagsSlot {
    public function handle(TypoScriptFrontendController $tsfe, LscacheService $lscacheService) {
        $lscacheService->cacheTags[] = "my_fancy_cachetag";
    }
}

cacheVariations

<?php
// ...
class CacheVariationsSlot {
    public function handle(TypoScriptFrontendController $tsfe, LscacheService $lscacheService) {
        $lscacheService->cacheVariations[] = "cookie=my_variation_cookie";
    }
}

beforePurge

<?php
// ...
class BeforePurgeSlot {
    public function handle(string $purgeIdentifier, LscacheService $lscacheService) {
        if ($purgeIdentifier === "*") {
            // Don't allow to purge everything (for some reason)
            $lscacheService->canPurge = false;
        }
    }
}

License

MPL v2

About

LiteSpeed Cache extension for TYPO3

License:Mozilla Public License 2.0


Languages

Language:PHP 100.0%