Cache files are temporary files that are created to improve the performance of your site. You need to ensure that cache files that have expired, so they are no longer needed, are removed from the system otherwise you will eventually run out of disk space.
Expired cache files can be manually purged at any time using one of the following procedures:
The purge expired cache files CLI application is located in the cli directory in your site's root directory (that is, the same directory as your configuration.php file). In this directory you will find a file called garbagecron.php. Simply enter this command to purge expired cache files:
This program does not produce any output unless some sort of error occurs.
If your host supports it, you can set up an automatic process to purge expired cache files on a regular basis.
Whilst the specifics are beyond the scope of this article, in general you will merely have to enter the relevant command into the cron job manager and specify the time or times on which the job is to be run. You will probably need to include the full path to the indexer. For example, like this
Most cron job managers will allow you to enter an email address to which a report will be sent if an error occurs. Because garbagecron.php does not produce any output unless an error occurs, you will not receive an email if the program runs successfully.