Release status: beta
|Implementation||Link markup, Special page|
|Description||Allows links to caches of externally linked websites. Also, includes ability to cache linked web pages locally on Wiki server.|
|Latest version||.8 (2014-06-04)|
|License||No license specified|
|Translate the WebCache extension if it is available at translatewiki.net|
|Check usage and version matrix.|
The WebCache extension allows access to external links via a web archive. The extension integrates with several popular web archives as well as supporting a local spider to cache pages on your web server.
The extension can place an icon for a link after the link to send the user to the cached version of the page. Alternatively, the extension can be configured to eliminate the original URL link and always send users to the specified cache. This setting is on a per wiki basis and can not be changed based on page status.
The extension offers administrators the option to cache locally on their wiki server external content. This local cache option could present security issues and administrators should weigh carefully whether they trust their authors and linked content sufficiently to save it locally on their server. There are a number of security related settings to control this risk. This was initially designed for kiosk like functionality where a mobile server may only intermittently have Internet access and still want to have all links functional when not connected. Cached files are not parsed when served, only transferred by the web server. The DOM is parsed by the wiki's PHP engine, but scripts should not be executed. Only http or https URLs are cached (mailto and FTP specifically are unsupported).
- 1 Installation
- 2 Configuration parameters
- 3 User rights
- 4 See also
If using the local PHP/Wiki based cache mechanism provided with this extension, PHP FileInfo must be enabled.
if using another local cache and update from Wiki is desired, your web server will need executable access to the file.
Copy into the extensions folder.
In LocalSettings.php, add the line
The default configuration included with the extension keeps the original link intact and appends a text link following the URL that links to the webcache.
Three routes based on desired target cache system.
This is the default of the installation. To switch later set "$WebCacheSystem = External".
This copies files linked to on the wiki locally. It includes a spider mechanism to update using the Wiki's job system.
- set "$WebCacheSystem = PHPWebCache".
- If desired, switch the local file directory and URL. The default settings create a "webcache" folder in the root of your wiki installation.
Other local cache
- Set "$WebCacheSystem = LocalWebCache".
- Set the baseURL to the base of the cache system.
- Set the command line option for cache update.
This option should be used at a minimum to test. First option is to postpend an icon with a link to the cache. Set $WebCacheEnableRewrite to true. Second option is to overwrite any links and force them to go to the cache, leaving no link to the original file. Set $WebCacheForceRewrite to true. This also disables the icon as it is not needed.
In addition to LocalSettings.php settings, there is also an update Special Page that can start an update on the cache (necessary for the included local cache option). Only users with 'manage_WebCache' right can access this page. Give a person or group this right.
Secure local cache
If using local cache, see Extension:WebCache/Security security settings page.
There are many and will be explained soon.
Depending on the sitewide configuration, all users will see the results of configuration settings for cache on the pages that they view. There is currently no option about who can see links to cached pages.
All rights are related to who can manage the cache. The default installation allows no one to update the cache. LocalSettings.php should allow some group to administer. This example shows how to allow the sysop group the ability to use the administrative page.
$wgGroupPermissions['sysop']['manage_WebCache'] = true;