I'm trying out litespeed cache. Sounds promising.

I added this to my .htaccess:

######### Begin - Litespeed cache
<IfModule LiteSpeed>
CacheDisable public /
RewriteEngine On
RewriteCond %{HTTP_HOST} ^mysite.ch$ [NC,OR]
RewriteCond %{HTTP_HOST} ^www.mysite.ch$ [NC]
RewriteCond %{HTTP_COOKIE} !logincookie
RewriteCond %{ORG_REQ_URI} !^/index.php$
RewriteCond %{ORG_REQ_URI} !mybackend
RewriteCond %{ORG_REQ_URI} (\.php|\.html|\.htm|\.feed|\.pdf|\.raw|/[^.]*)$ [NC]
RewriteRule .* - [E=Cache-Control:max-age=120]
########## End - Litespeed cache

In the header of the delivered URL, I can see x-litespeed-cache: hit, which is fine.

But what about images and other resources? They don't have that in the header. Shouldn't litespeed cache cover them as well?

I looked at the images on Litespeed's own website and saw they have x-lsadc-cache in the header. Is that something else?

  • 1
    It usually doesn't make sense to "cache" local static resources, because they are already available on the storage and are already static, so caching would do nothing but store a duplicate copy. – Michael Hampton Dec 23 '18 at 20:38
  • That's probably the answer.. – Urs Dec 23 '18 at 20:43

LiteSpeed won't cache images, because as Michael Hampton already mentioned, it doesn't really make sense to do - they're static files and will be served as fast as they can anyway.

The x-lsadc-cache you see on https://litespeedtech.com/ is from the WebADC which is the load balancing software offered by LiteSpeed, and this has different functionality, such as also caching static files

| improve this answer | |
  • 1
    It makes good sense to cache (locally) static files retrieved from a remote server though, as a load balancer might do! – Michael Hampton Dec 23 '18 at 20:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.