Get XOOPS XOOPSXOOPS FAQFAQ ForumsForums NewsNews ThemesThemes ModulesModules

Search

Donate to XOOPS!

Please select an amount to donate


Do you want your username revealed with your donation?
Yes - List me as a Generous Donor
No - List my donation as from an Anonymous Donor


Local Support

Advertisement

XOOPS Code hosted on SourceForge

Cumulus Tag Cloud

admin Arabic banner block Christmas comments cumulus DayDawn dhsoft e-Commerce E-Learning Git Google GUI hacks instant-zero jQuery module mygalleries news Nordic Olédrion oxygen PageRank PHP rmcommon security SEO simple-XOOPS Smarty sport tag Theme tutorial wiki WOX xoops XoopsEngine ZendFramework

New Users

Registering user

# 133947

website_make

Welcome to XOOPS!
[Main Page]

Help:File cache

From XOOPS Web Application System

Main Page | Recent changes | Edit this page | Page history | Switch to MediaWiki mode

Printable version | Disclaimers | Privacy policy

Template:MoveToMediaWiki Mediawiki supports a basic file cache for static pages for non-logged-in visitors. When an anonymous user requests a page it is constructed from the database, and also stored in the cache. When the same page is requested later on, it is directly served from the cache, without the need to query the database. This will reduce the database and server load on public sites.

Enabling the cache

The file cache is enabled by setting these variables in LocalSettings.php:

$wgUseFileCache = true;
$wgFileCacheDirectory = "/tmp/yourcache";
$wgShowIPinHeader = false;
$wgUseGzip = false;

See also $wgUseFileCache, $wgFileCacheDirectory, $wgShowIPinHeader,$wgUseGzip

Setting $wgShowIPinHeader to false is required. Since the cache serves the same page to many visitors, it's not possible to include the unique IP number of the current visitor in the page.

Setting $wgUseGzip to false is currently (1.3.0beta6) required to workaround a bug. This implies that files are cached and sent over the wire uncompressed (saves CPU cycles, at the cost of bandwith).

You need to manually create the top level cache directory and make sure Mediawiki can write to it:

mkdir -p /tmp/yourcache
chmod -R 777 /tmp/yourcache

Mediawiki will automatically create a two-level directory structure in the cache directory, to improve performance of file retrieval from the cache.

You can see that the cache works by repeatedly refreshing a page with a visitor counter. Even with a forced reload (Shift-Reload in mozilla or Ctrl-Shift-Refresh in Internet Explorer) the counter will not increment.

Limitations

  • It's not possible to limit or manage the size of the cache. (On Linux, see tmpwatch(8) for a good way to manage this.)
  • Dynamic elements of a page (such as the visitor counter) will not be refreshed.
  • Only a part of the traffic is cached. Logged-in users, special pages etc. are not cached.

Todo

  • How does expiry work exactly?
  • Should $wgCacheEpoch be explained?
  • Point out other caching techniques (squid, Cache strategy)

Retrieved from "http://xoops.org/modules/mediawiki/index.php/Help:File_cache"

This page has been accessed 1,317 times. This page was last modified 06:55, 20 November 2007. Content is available under XOOPS Web Application System.