Periodic Cache Cleanup for Virtual Host Caches

#1
I'm using the default server level lscache location currently, but I'd like to move to individual virtual host directories so I can keep an eye on the size of the cache for each website. According to the article below, if I'm using virtual host level cache directories, LiteSpeed does not automatically do cleanup as it does on the default server level cache directory. It suggests running lsws/admin/misc/cleancache.sh periodically to do cleanup on non-default cache directories. (See the "Do It Yourself" section of the article below.)

https://blog.litespeedtech.com/2018/05/02/managing-litespeed-cache-storage/

But I do not see the cleancache.sh script. Is this still needed, or does OLS now automatically do the periodic cleanup of the storagePath specified for each virtual host? If cleanup still needs to be configured, is there a new script to do it?

Thanks.
 

LiteCache

Active Member
#4
@KratosGemini

Basically, there is no need to delete the /lscache directory manually. LScache has a self-cleaning function that automatically deletes all cache files. However, only for these cache files whose lifetime has expired. Caches of URLs that have been manually purged are not affected. This inevitably results in an undefined number of cache files that are no longer used and thus remain as dead files. However, this does not necessarily mean that the memory could overflow. Based on experience and using LScache for more than 15 years, the amount of unused cache files is very small. Nevertheless, you can set up a system chron that cleans the LScache directory.
 
Top