Purge in WordPress cache plugin

Hedloff

Well-Known Member
#1
Hello,

I have some issues with a customer that has a site that has LSCWP enabled and it's working fine.
But he's lscache folder is filling up with many GB's. And even if he choose "Purge All" in he's plugin nothing changes in lscache folder.

Is this normal or shouldn't lscache files/folder be deleted when customer uses "Purge All"?
I read some time that it's needed to setup a cron job for this? Hope this is not necessary and that it's just my setup on the server that needs to be checked/changed?
 

mistwang

LiteSpeed Staff
#2
purge from the plugin does not remove those files physically. just mark those files as out dated.
To remove old files, use /usr/local/lsws/admin/misc/cleancache.sh

If you upgrade to LSWS 5.1.x, expired cache entry will be removed soon after it expires. For older version, need to run cleancache.sh from a cron job.
 

Hedloff

Well-Known Member
#5
I tried running cleancache.sh but nothing is deleted.
Customer is having their lscache folder setup like this:

/home/username/lscache/domain.tld/

Content of that folder:

drwxrws--- 19 nobody username 4096 Sep 14 11:02 ./
drwxr-xr-x 3 username username 4096 Apr 19 22:24 ../
drwxrws--- 18 nobody username 4096 Sep 14 12:02 0/
drwxr-sr-x 2 username username 4096 Sep 14 10:53 01/
drwxrws--- 18 nobody username 4096 Sep 14 11:32 1/
drwxrws--- 18 nobody username 4096 Sep 14 11:41 2/
drwxrws--- 18 nobody username 4096 Sep 14 11:40 3/
drwxrws--- 18 nobody susername 4096 Sep 14 12:19 4/
drwxrws--- 18 nobody username 4096 Sep 14 12:58 5/
drwxrws--- 18 nobody username 4096 Sep 14 11:24 6/
drwxrws--- 18 nobody username 4096 Sep 14 12:28 7/
drwxrws--- 18 nobody username 4096 Sep 14 11:58 8/
drwxrws--- 18 nobody username 4096 Sep 14 13:24 9/
drwxrws--- 18 nobody username 4096 Sep 14 11:53 a/
drwxrws--- 18 nobody username 4096 Sep 14 12:03 b/
drwxrws--- 18 nobody username 4096 Sep 14 12:43 c/
-rw-r--r-- 1 username username 8192 Aug 25 07:29 .cacheman.lock
-rw-r--r-- 1 username username 57344 Aug 25 07:30 .cacheman.shm
-rw-r--r-- 1 username username 23930 Sep 13 18:41 .cm.log
drwxrws--- 18 nobody username 4096 Sep 14 12:19 d/
drwxrws--- 18 nobody username 4096 Sep 14 12:44 e/
drwxrws--- 18 nobody username 4096 Sep 14 11:52 f/

Any ideas?
How can I easily check when server was upgraded to 5.1.x? I think it was before september 14.
Is it possible to get verbose output of the cleancache.sh script?
 

Hedloff

Well-Known Member
#6
I also upgraded to 5.1.9, but no changes there.

But I saw the cache root setup in whm plugin and this is was setup:

Current Recommended
Server level
/tmp/ /home/lscache/
VHost level lscache/$vh_domain* lscache*

Is there any reason why you recommend /home/lscache/ instead of tmp?
lscache* will not work fine if you have more than 1 vhost on the hosting account? I thought you would recommend different folders for each domain.
 

Hedloff

Well-Known Member
#8
I have not had issues with tmp running full anytime lately, but it's also 12GB of diskspace aswell.
What does the server level usally cache from LScache?

Didn't get any answer/tips on the cleancache.sh script and I cannot find much documentation on that script on your documents either.
 

NiteWave

Administrator
#9
the script basically delete all cache files created(modified) 24 hours ago.
for example you gave, lscache folder is /home/username/lscache/domain.tld/
the usage is:
#/usr/local/lsws/admin/misc/cleancache.sh /home/username/lscache/domain.tld/

you can do it manually by run normal unix/linux command:
1) cd /home/username/lscache/domain.tld/
2) find . -type f -min 1440 -delete

or simply delete all cache files:
1)cd /home/username/lscache/domain.tld/
2)rm -rf *

if user have some basic experience about linux/unix commands and shell script, it's short and easy to understand, I think that's why no document about it.
 

Hedloff

Well-Known Member
#10
Thanks for your reply. That's was what I was looking for.
I have now confirmed that cache files are automatically deleted on version 5.1.x so it's working as it should :)
 

Hedloff

Well-Known Member
#12
For server level cache root, normally /home/lscache/, /tmp partition is normally easy to run out of space.
For each virtual host, normally /home/username/lscache/

This is aligned to our cache root setup instructions:
https://www.litespeedtech.com/suppo..._wiki:cache:common_installation:cpanel-shared
But you also write:
"Server level cache root will only be used when a vhosts cache root is not set."

So basically server level cache root will not be used at all since we have setup vhost cache root set?
And the script "
bash <(curl http://www.litespeedtech.com/packages/lscache/set_cache_root_policy.sh)" will create the /home/lscache/ folder when it is runned?
 

Pong

Administrator
Staff member
#13
Thank you for the feedback and sorry for the confusing. That line has been removed from the wiki. It means to say user can manage their own cache through virtual host cache.

The standard practice is to set both server level cache root and virtual host level cache root, especially for shared hosting. LSWS has its own logic to determine how to use them.
 
Top