Manual:$wgFileCacheDirectory
From Linux Web Expert
<translate> Server URLs and file paths</translate>: $wgFileCacheDirectory | |
---|---|
Directory where the cached pages will be saved when using server-side caching. |
|
<translate> Introduced in version:</translate> | pre 1.1.0 |
<translate> Removed in version:</translate> | <translate> still in use</translate> |
<translate> Allowed values:</translate> | (absolute path) |
<translate> Default value:</translate> | "{$wgUploadDirectory }/cache" (<translate> Note:</translate> <translate> The default value of this variable depends on other variables, such as the values set in <tvar|1>Setup.php </>, after <tvar|2>LocalSettings.php </> is executed</translate>) |
<translate> Other settings:</translate> <translate> Alphabetical</translate> | <translate> By function</translate> |
Details
If you switch on server-side file caching $wgUseFileCache = true;
, then you can use this variable to specify where the cached pages will be saved on your server filesystem.
It's an absolute path, so you could specify somewhere under /tmp
for example:
$wgFileCacheDirectory = "/tmp/yourcache";
...but you can specify this absolute path in relation to other directory path variables, e.g.:
$wgFileCacheDirectory = "{$wgUploadDirectory}/cache";
This specifies a "cache" directory under the image uploads directory (normally called "images"). This is the default setting in fact.
The directory will be created automatically if it does not exist. If the server is unable to create the directory, this needs to be done manually. The PHP user must have write access to the cache directory.
If you are hosting multiple wikis from a shared source, you must ensure each has its own separate cache directory to avoid mis-serving pages with the same name (the Main Page, for example).
See also
- Manual:File cache
- Manual:$wgUseFileCache - Enabling file caching
- Manual:$wgFileCacheDepth - Depth of the subdirectory hierarchy to be created under $wgFileCacheDirectory.
- Manual:$wgCacheDirectory