Hello,
I've installed OLS (v1.6.14) and CyberPanel.
I am trying to get my head around how the LS caching works.
I've managed to figure out that the cache files are stored in `/usr/local/lsws/cachedata/`. This folder is not writable to the hosts.
It appears all websites on the server store their cache files in that same one folder. Is that correct?
I am trying to understand how this works, because I would have thought each host/site should have its own cache folder, writable to the host, and that way when an application on that host (such as Wordpress, or in my case Craft CMS 3) needs to clear a page from the cache, it can. Or if the application needs to flush the entire cache, it can. Without affecting the cache of all the other sites on the server.
I have installed a LiteSpeed Cache plug-in on Craft. For it to work, it needs the path to the LSCache. Currently, when I change a page on the site, the server does not deliver the changed page, but continues to deliver the cached page. I know that's because Craft (and its plug-in) can't remove the cached page without the LSCache path. I can't use the `/usr/local/lsws/cachedata/` path, because the host has no access to it.
I should also mention that even when I put `RewriteRule .* - [E=Cache-Control:no-cache]` into the .htaccess file on the Craft site, the pages continue to cache. There seems to be no way to prevent caching from occurring. I can remove the entire rewrite rule section for LiteSpeed, and caching still occurs. I am not sure why that's the case.
The rewrite section I read in OLS doc to use for Craft CMS is:
```
########## Begin - Litespeed cache
<IfModule LiteSpeed>
RewriteEngine On
RewriteCond %{REQUEST_METHOD} ^HEAD|GET$
RewriteCond %{ORG_REQ_URI} !/admin
RewriteCond %{ORG_REQ_URI} !/index.php/admin
RewriteRule .* - [E=Cache-Control:max-age=86400]
</IfModule>
########## End - Litespeed cache
```
Would someone please explain what I am overlooking here or not understanding fully?
Thanks very much...
Jonathan
I've installed OLS (v1.6.14) and CyberPanel.
I am trying to get my head around how the LS caching works.
I've managed to figure out that the cache files are stored in `/usr/local/lsws/cachedata/`. This folder is not writable to the hosts.
It appears all websites on the server store their cache files in that same one folder. Is that correct?
I am trying to understand how this works, because I would have thought each host/site should have its own cache folder, writable to the host, and that way when an application on that host (such as Wordpress, or in my case Craft CMS 3) needs to clear a page from the cache, it can. Or if the application needs to flush the entire cache, it can. Without affecting the cache of all the other sites on the server.
I have installed a LiteSpeed Cache plug-in on Craft. For it to work, it needs the path to the LSCache. Currently, when I change a page on the site, the server does not deliver the changed page, but continues to deliver the cached page. I know that's because Craft (and its plug-in) can't remove the cached page without the LSCache path. I can't use the `/usr/local/lsws/cachedata/` path, because the host has no access to it.
I should also mention that even when I put `RewriteRule .* - [E=Cache-Control:no-cache]` into the .htaccess file on the Craft site, the pages continue to cache. There seems to be no way to prevent caching from occurring. I can remove the entire rewrite rule section for LiteSpeed, and caching still occurs. I am not sure why that's the case.
The rewrite section I read in OLS doc to use for Craft CMS is:
```
########## Begin - Litespeed cache
<IfModule LiteSpeed>
RewriteEngine On
RewriteCond %{REQUEST_METHOD} ^HEAD|GET$
RewriteCond %{ORG_REQ_URI} !/admin
RewriteCond %{ORG_REQ_URI} !/index.php/admin
RewriteRule .* - [E=Cache-Control:max-age=86400]
</IfModule>
########## End - Litespeed cache
```
Would someone please explain what I am overlooking here or not understanding fully?
Thanks very much...
Jonathan
Last edited: