Purging expired cache files: Difference between revisions
From Joomla! Documentation
Created page with "{{RightTOC}}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 longe..." |
Several markup and capitalization changes. |
||
| Line 1: | Line 1: | ||
{{RightTOC}}Cache files are temporary files that are created to improve the performance of your site. | {{RightTOC}}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. | ||
== | == Purging Expired Cache Files == | ||
Expired cache files can be | Expired cache files can be purged at any time using one of the following procedures: | ||
* From the Administrator, use the [[Help25:Site Maintenance Purge Expired Cache|Purge Expired Cache]] option. | * From the Administrator, use the [[Help25:Site Maintenance Purge Expired Cache|Purge Expired Cache]] option. | ||
* From the command line, run the | * From the command line, run the ''garbagecron.php'' script, described below. | ||
==Purging | == Purging Expired Cache Files from the Command Line == | ||
The purge expired cache files CLI application is located in the | 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: | ||
< | <syntaxhighlight lang="bash"> | ||
php garbagecron.php | php garbagecron.php | ||
</ | </syntaxhighlight> | ||
This program does not produce any output unless some sort of error occurs. | This program does not produce any output unless some sort of error occurs. | ||
==Automatically | ==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. | 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 [[Wikipedia:cron|cron]] job manager and specify the time or times on which the job is to be run. | Whilst the specifics are beyond the scope of this article, in general you will merely have to enter the relevant command into the ''[[Wikipedia:cron|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: | ||
< | <syntaxhighlight lang="bash"> | ||
php /var/www/myjoomla/cli/garbagecron.php | php /var/www/myjoomla/cli/garbagecron.php | ||
</ | </syntaxhighlight> | ||
Most cron job managers will allow you to enter an email address to which a report will be sent if an error occurs. | 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== | ==Notes== | ||
* Caching is switched off by default. | * Caching is switched off by default. To enable the cache for your site see [[Help25:Site Global Configuration]]. | ||
<noinclude>[[Category:Cache]]</noinclude> | <noinclude>[[Category:Cache]]</noinclude> | ||
Latest revision as of 16:55, 29 November 2022
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.
Purging Expired Cache Files
Expired cache files can be 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:
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
- Caching is switched off by default. To enable the cache for your site see Help25:Site Global Configuration.