0

I'm trying out litespeed cache. Sounds promising.

I added this to my .htaccess:

######### Begin - Litespeed cache
<IfModule LiteSpeed>
CacheDisable public /
RewriteEngine On
RewriteCond %{REQUEST_METHOD} ^HEAD|GET$
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]
</IfModule>
########## 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?

Urs
  • 115
  • 3
  • 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

1 Answers1

2

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