Unable to Get LSCache Vary Cookies Working

#1
Hello,
I'm new to OpenLiteSpeed. I started using it on a new VPS last December and decided to migrate all my projects to it.
For this reason I've also installed it on my dev PC (currently running Ubuntu via WSL, but I plan to move it to a VM on my NAS in the future).

At this point, I'm comfortable managing most configurations.

In the coming months, I plan to launch a website that I expect will receive significant traffic, so I'm currently studying LSCache.
I’ve successfully implemented both private and public cache, but I’m having trouble getting cache variation based on cookies to work as expected.

Here’s my use case.

My site uses two cookies, font and theme. Their numeric values instruct my application to load specific CSS files supporting an optional light theme and a different font (OpenDyslexic) compared to the default.
I’m aware that a media query could be used to detect dark/light mode, but I prefer to let users make that choice explicitly.

I’ve studied the LSCache documentation regarding Vary cookies, but I haven’t been able to make it work.

Here’s what I’ve tried so far.

1. Adding this rewrite rule:
RewriteEngine on
RewriteRule .* - [E="cache-vary:font,theme"]

I tried to place this both in the .htaccess file at the site’s document root and in the Rewrite tab within the OpenLiteSpeed WebAdmin Console.

2. Sending this header from my application:
X-LiteSpeed-Vary: cookie=font,cookie=theme


Neither approach had any effect.

I then learned that OpenLiteSpeed automatically handles cookies prefixed with _lscache_vary, so I renamed my cookies to:
_lscache_vary_font
_lscache_vary_theme
Still no improvement.

I also set no_vary 0 in the cache module configuration.
In addition, the module settings include:
reqCookieCache 1 respCookieCache 1


By "doesn't work", I mean the following...

I open the site in both Chrome and Firefox (the site runs on a custom HTTPS domain with a self-signed certificate and points to 127.0.0.1).
When I switch the theme in one browser, the other browser still receives pages cached with the theme selected in the first one.

I'm running OpenLiteSpeed version 1.8.3, which is the latest available for my system via the package repository.

After each configuration change, I always restart the server and purge the cache using a custom header designed for that purpose.

Any help would be appreciated.
I could fall back on using private cache (as some tutorials suggest for any site that uses cookies, not just for logged-in areas or shopping carts), but I’m concerned about the potential performance impact.
More importantly, I’d like to learn how to solve this properly.

Thanks in advance for any guidance.

By the way, I already tried asking AI tools, but they often confuse OpenLiteSpeed with LiteSpeed Enterprise and suggest directives that aren’t supported in OLS.
 
Top