LiteMage Cache Cleanup

Like most caches, LiteMage Cache needs to be periodically cleaned to prevent the cache storage from growing too large. Deleting these files by flushing the cache through Magento could slow down your site and it would instead be preferable to do this cleaning in a separate process. To this end, when the cache is flushed, LiteMage only marks files as “expired” rather than deleting them outright. LiteSpeed Web Server periodically cleans up the storage directory and deletes cache entries that have reached their natural expiration date, but it does not apply to these entries that have been marked as “expired” through flushing. For that you can use our script.

We have included a cleanlitemage.sh script in the admin/misc directory of your LSWS installation directory.

This script takes the following input parameters:

Note: The values (in minutes) used for -priv and -pub should be set higher than Default Private Cache TTL (seconds) and Default Public Cache TTL (seconds) in LiteMage's Configuration settings in the Magento Admin Panel. This will ensure that you are only purging expired files.

Tip: Once you have found a combination of settings that keeps your cache size reasonable, you can then include this script in a cron job to automate the process.