LSCache Storage location?

sahith

Well-Known Member
#1
I have been using litespeed from past 3 years. I used to have the lscache enabled through following command in htaccess
Code:
RewriteRule ^(.*)$ - [E=Cache-Control:max-age=3600]
and storage location set to server tempfs path /dev/shm/lscache in 'Cache' settings through WHM > Litespeed interface.
It used to be work good and all domains cache was stored in specified path. From then i never looked at it.

I recently discovered from past 4 months, LScache is being stored in "lscache" directory in respective domain name home directory.

I need help to get that storage back to /dev/shm/lscache
 
Last edited by a moderator:

Lauren

LiteSpeed Staff
Staff member
#2
If it's shared server, it's preferred to set at each user's home directory. So the user will have permission to delete the cache folder if needed.
If it's your own dedicated or vps server, you can set to /dev/shm if you have enough memory.
Please check this wiki https://www.litespeedtech.com/suppo..._wiki:cache:common_installation:cpanel-shared for path set through cpanel. You can modify it to your way.
LSCache plugin is much more advanced than the old rewrite rule based cache, it's purge on demand therefore you can have a very long TTL without anything outdated.
Try modify based on that wiki and see if it works as expected.
Regards,
Lauren
 

sahith

Well-Known Member
#3
Capture.JPG
Its my own dedicated server. and my cache path is already set to /dev/shm/lscache. But it is still storing cache at domain directory.

I also wonder where my cache manager is being stored, as i have not mentioned any path in Admin.
 
Last edited:

sahith

Well-Known Member
#5
No, Lscache was not configure at vhost level. It only enabled through htaccess line and storage location specified at whm interface. Nothing i did to change storage location to domain level.
 

Pong

Administrator
Staff member
#6
You will need to set it. Please closely follow our wiki and don't miss the important steps. For example, if you use cpanel, all setting in your image showed above should be removed. instead, set virtual host and server level from apache conf file. what application do you use? Wordpress? If so, you will need to install the cache plugin for wordpress, then there is no "RewriteRule ^(.*)$ - [E=Cache-Control:max-age=3600]" at all.
 

sahith

Well-Known Member
#7
I am novice, i do not know how to edit back-end. You can see i am using cpanel which means i need an interface to opereate the server.

Whats the purpose of Litespeed Cpanel interface if i cant edit from there?
 

sahith

Well-Known Member
#8
I tried adding following in cpanel Apache Include Editor.

@ Server Level

This screen searches for server-level cache root definitions in either the /usr/local/apache/conf/includes/pre_main_global.conf file or in the LiteSpeed Web Server Web Admin Storage Path setting found under Server > Cache > Cache Storage Settings.

If it is defined in pre_main_global.conf it should look something like this:
Code:
<IfModule LiteSpeed>
CacheRoot /dev/shm/lscache/
</IfModule>
Still not working...
 
Last edited by a moderator:

sahith

Well-Known Member
#10
I removed following lines from /usr/local/apache/conf/userdata/lscache_vhosts.conf
Code:
<IfModule LiteSpeed>
CacheRoot lscache
</IfModule
Now cache is saving to /dev/shm/lscache.. ;)
 
Top