This is an old revision of the document!


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 LiteMage will only mark files as “expired” when the cache is flushed instead of deleting them outright. To do the actual cleaning, we have included a cleanlitemage.sh script in the admin/misc directory of your LSWS installation directory.

This script takes from one to three plus input parameters, which are as follows:

  • -priv <age_mins> - (Optional) - Determines the maximum age (in minutes) of items stored in the private cache. The default value is 60 minutes. If set, value must be greater than 0.
  • -pub <age_mins> - (Optional) - Determines the maximum age (in minutes) of items stored in the public cache. The default value is 0, meaning public cache will not be purged. If set, value must be greater than 10.
  • <litemage_cache_dir1> … <litemage_cache_dir9> - (Required) - Specifies one or more LiteMage cache storage directories separated by spaces. Each directory must contain the /priv directory.

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.

  • Admin
  • Last modified: 2016/05/06 13:23
  • by Michael Alegre