Skip to content

Works with your stack

Cookie consent for LiteSpeed Cache

guest mode included

← Cookie Rocks for your stack

LiteSpeed Cache can defer and combine scripts, and serve a ready-made guest version of every page. A consent script caught in that machinery runs late, or not at all.

By LiteSpeed Technologies · litespeedtech.com · WordPress.org

Is this your product? Tell us if anything here is out of date. Write to us

LiteSpeed Cache

WordPress plugin

Tested
Tested version
7.9.3
How
Tested automatically around each Cookie Rocks version
Last test
7 November 2026
Latest version
7.9.3 tested
Active installs
7,000,000+

What LiteSpeed Cache adds to your visitors’ browser

No trackers In our test of LiteSpeed Cache 7.9.3 on 7 November 2026, the plugin itself added no tracker and no cookie. What you place in your pages with it, such as a video or a map, still counts.

What matters for consent with LiteSpeed Cache

JavaScript optimisation

LiteSpeed can combine, minify and defer scripts. The consent script has to stay out of all three.

Guest Mode

Guest Mode serves first-time visitors a prepared page and has its own list of scripts to leave alone.

Its own cookies

LiteSpeed sets cookies such as _lscache_vary to serve the right version of a page. They are needed by the cache itself and need no consent.

A cache in the server

On a LiteSpeed server, pages are kept by the server itself and served before WordPress runs. Nothing in a cached page can depend on one visitor.

Fonts and images

LiteSpeed can also load Google Fonts later, or lazy load images and frames. A frame that loads later still needs consent when it loads.

Cookie Rocks with LiteSpeed Cache

  • Adds the banner’s scripts to its exclusions from delay, combining and minifying.
  • Marks the consent script so it is neither moved nor delayed.
  • Clears its page cache when you change something visitors can see.
  • Holds the scripts it delays until the first interaction, runs them at once after consent, then leaves them to it on the next pages.

All the features

What our tests found on LiteSpeed Cache

  • Good to know · LiteSpeed CacheWhat LiteSpeed Cache stores in visitors' browsers

    LiteSpeed Cache: 2 cookie(s) or browser key(s) for visitors, recognised by Cookie Rocks from 2.9.8.

    NameKept inCategoryWhat it is for
    litespeed_docrefsessionStorageNecessaryServes the right version of the page from the cache (guest mode)
    litespeed_reloadedsessionStorageNecessaryServes the right version of the page from the cache (guest mode)

    Read in its code, 2 November 2026, LiteSpeed Cache.

    Full detail

    LiteSpeed Cache can store these in a visitor's browser: litespeed_docref (sessionStorage, necessary: Serves the right version of the page from the cache (guest mode)); litespeed_reloaded (sessionStorage, necessary: Serves the right version of the page from the cache (guest mode)). Cookie Rocks recognises them from 2.9.8, with this category and purpose, and lists them in the cookie policy when it sees them.

  • Good to know · LiteSpeed CacheLiteSpeed's Load JS Delayed can delay Google's consent default

    setting “Load JS Deferred”

    Its delay exclusions do not include gtag, so another plugin's consent default runs only at the first gesture unless excluded. Trackers held by a consent plugin stay untouched.

    Read in its code, 16 October 2026, LiteSpeed Cache 7.9.1.

    Full detail

    LiteSpeed Cache's built-in exclusion list for combining (data/js_excludes.txt) contains gtag, gtm and dataLayer, but its list for deferred and delayed loading (js_defer_excludes.txt) does not. An inline gtag('consent','default',...) added by another plugin is therefore turned into type=litespeed/javascript under Load JS Delayed and runs only at the first gesture unless excluded. Only scripts with no type or text/javascript are processed, so trackers held as text/plain stay untouched.

  • Good to know · LiteSpeed CacheLiteSpeed Cache lazy loading skips held frames

    Frames with no address or with data-src are left alone. Load Google Fonts Asynchronously only changes timing: the browser still contacts fonts.googleapis.com.

    Read in its code, 16 October 2026, LiteSpeed Cache 7.9.1.

    Full detail

    LiteSpeed Cache's iframe lazy load skips an iframe with no src, or with data-src, data-no-lazy, data-skip-lazy or data-lazyloaded, and adds a noscript copy to the others. Under Load JS Delayed, iframes it processes get data-litespeed-src until the first gesture. Load Google Fonts Asynchronously only changes when Google Fonts load: the browser still contacts fonts.googleapis.com.

  • Good to know · LiteSpeed CacheLiteSpeed Cache sets _lscache_vary only for logged-in users and commenters

    Without Guest Mode, this cookie (2 days by default) lets the cache serve them their own version. Its front-end code contacts no third party and sets no consent default.

    Read in its code, 16 October 2026, LiteSpeed Cache 7.9.1.

    Full detail

    Without Guest Mode, LiteSpeed Cache sets its _lscache_vary cookie (HttpOnly, 2 days by default) only for logged-in users and commenters with a pending comment, so the cache can serve them their own version. Its front-end code contacts no third-party service, has no WP Consent API code and sets no Consent Mode default.

  • Good to know · LiteSpeed CacheCookie Rocks adds its scripts to LiteSpeed Cache exclusions automatically

    It does so while the page is built, so the lists saved in LiteSpeed's settings do not change. Without a LiteSpeed web server, LiteSpeed Cache sets no cookie.

    Seen in our tests, 15 October 2026, LiteSpeed Cache 7.9.1.

    Full detail

    Cookie Rocks adds cookie-rocks, cookieRocks and crHead to LiteSpeed Cache's JavaScript, defer and Guest Mode exclusions while the page is built; the lists saved in LiteSpeed's settings stay as they are. Without a LiteSpeed web server, LiteSpeed Cache sets no cookie; its page cache and _lscache_vary were not part of the test.

  • Good to know · LiteSpeed CacheLiteSpeed Cache JavaScript options keep the Cookie Rocks banner working

    With minify, combine, Load JS Delayed and Guest Mode on, the banner script stays first and the banner shows. Trackers are held until Accept all, even after the first gesture.

    Seen in our tests, 15 October 2026, LiteSpeed Cache 7.9.1.

    Full detail

    With LiteSpeed Cache's JavaScript minify, combine (inline scripts included) and Load JS Delayed on, and also with Guest Mode and its optimisation on, the Cookie Rocks head script stays first in the head and untouched, the engine stays a separate file, the banner shows, and the page's trackers are held, even after the first gesture, until Accept all.

  • Good to know · LiteSpeed Cache, W3 Total Cache, SiteGround Optimizer, AutoptimizeCache plugins' JavaScript options keep the Cookie Rocks banner first

    With LiteSpeed Cache, W3 Total Cache, SiteGround Optimizer or Autoptimize combining or delaying scripts, the banner script stays first and untouched, and trackers are held until Accept all.

    Seen in our tests, 15 October 2026, LiteSpeed Cache, W3 Total Cache, SiteGround Optimizer, Autoptimize 7.9.1, 2.10.7, 7.8.4, 3.1.16.

    Full detail

    With JavaScript combined, minified or delayed (LiteSpeed Cache including Guest Mode and Load JS Delayed, W3 Total Cache minify in auto mode, SiteGround Optimizer combine and async, Autoptimize aggregate including inline JS), the Cookie Rocks head script stays first and untouched, its engine stays a separate file, and trackers are held until Accept all. Without a LiteSpeed web server, LiteSpeed Cache sets no cookie.

How we test it

Around each version, with its latest release

Around each Cookie Rocks version, a fresh WordPress installs its latest version from WordPress.org next to Cookie Rocks and runs the same checks. A new version joins the next run on its own.

  • LiteSpeed Cache 7.9.3, tested on 7 November 2026.
  • The banner shows, the trackers of the test page wait for consent and load after it, and Cookie Rocks raises no PHP error.
  • Settings of the test: Default settings after activation.
  • Last run: LiteSpeed Cache 7.9.3 on 7 November 2026, with WordPress 7.1.3.

Light as a pebble

11.43 kB once, 1.00 kB per page. Measured, not promised.

lighter than the font on this page*

Every kilobyte costs your visitors time and costs you Core Web Vitals. Cookie Rocks adds 11.43 kB to the first page a visitor opens, then 1.00 kB to each page after that, because its files stay in the browser cache. It calls no outside server and never shifts your layout.

11.43 kB First visit, in total

1.00 kB Each next page

7.74 kB JavaScript, first visit

3.48 kB Stylesheet, first visit

0 Requests to other servers

0 Layout shift caused

* The font on this page is Inter, compressed and cut down to the Latin alphabet. It still weighs 26.23 kB.

Questions

Will visitors see each other’s choices in a cached page?

No. The choice is read in the browser, after the page arrives, so the cached page is the same for everyone.

What happens after the 30-day trial?

The banner, your visitors’ choices and your proofs of consent keep working. Without a key, most settings lock, updates and support stop. Take a key at any time and everything opens again.

For LiteSpeed sites

Keep LiteSpeed, add consent.

same page for everyone

Every feature of the complete plugin on your LiteSpeed site for 30 days, no card.

  • During the trial: everything, including the full settings and the scans
  • After 30 days without a key: the banner, your visitors’ choices and your proofs of consent keep working
  • What waits for a key: most settings, updates and support

How the trial works, in detail

Get your trial key

Your e-mail and your site. Your key arrives as soon as you confirm your e-mail.

One trial per domain. Local and staging sites never use up your key.

We keep your e-mail address to send your key and help you with it, as explained in our privacy policy. No newsletter, nothing else.