Extension:WebCache

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).

External cache
None

Internal cache
If using the local PHP/Wiki based cache mechanism provided with this extension, PHP FileInfo must be enabled.

See:
 * https://secure.php.net/book.fileinfo
 * https://secure.php.net/fileinfo.configuration

Local cache
if using another local cache and update from Wiki is desired, your web server will need executable access to the file.

Install Extension
Copy into the extensions folder.

Enable Extension
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.

Configure
Three routes based on desired target cache system.

External cache
This is the default of the installation. To switch later set "$WebCacheSystem = External".

Included cache
This copies files linked to on the wiki locally. It includes a spider mechanism to update using the Wiki's job system.
 * 1) set "$WebCacheSystem = PHPWebCache".
 * 2) 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

 * 1) Set "$WebCacheSystem = LocalWebCache".
 * 2) Set the baseURL to the base of the cache system.
 * 3) Set the command line option for cache update.

Enable
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.

Administering
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.

Configuration parameters
There are many and will be explained soon.

User rights
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.