Actions

Purging expired cache files

From Joomla! Documentation

Revision as of 04:49, 5 August 2012 by Chris Davenport (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Contents

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.

Manually purging expired cache files

Expired cache files can be manually purged at any time using one of the following procedures:

  • From the Administrator, use the Purge Expired Cache option.
  • From the command line, run the garbagecron.php script, described below.

Purging expired cache files from the command line

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:

php garbagecron.php

This program does not produce any output unless some sort of error occurs.

Automatically purging expired cache files

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

php /var/www/myjoomla/cli/garbagecron.php

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.

Notes