Skip Navigation

HowTos

Apache 2.2 mod_cache

Server Tuning

Petal i18n and I18NFool

HowTo Compile Apache 1.3 for MKDoc

Integrate Soupermail

Creating new document components

Translate MKDoc Templates

Checkout MKDoc via anon CVS

Configuring MKDoc::Apache_Cache

MySQL commands to make a user account an editor account

Using news headlines

Customisation with CSS

Hiding documents and creating private areas

Upgrade from 1.4 to 1.6

Discussion Board Moderation

Text Component Formatting

Site Administration

Email newsletters

Edit Templates in a Subversion Repository

Update the Metadata for all Documents

Import MS Word files into MKDoc

Files

cache-policy

Sign up

If you sign up for an account on this web site you can customise elements of this site and subscribe to an email newsletter.

If you have an account on this web site you may login.

If you have an account on this site but have forgotten your user name and / or your password then you can request an account reminder email.

Configuring MKDoc::Apache_Cache

A cache is a temporary store for documents that allows them to be quickly retrieved and served repeatedly – The purpose is to prevent a situation where repeated requests for a web address URI causes the server to duplicate effort fetching and reassembling data from various sources.

MKDoc has an internal cacheing mechanism at the document level. Authors can state how long they intend information in a document to stay current – This method is now deprecated in favour of a site-wide policy for cacheing all data, not just documents.

Cache Policies

As an example, a cache policy might say that articles are unlikely to change rapidly and can therefore be cached for a long time, however a news headlines page may change all the time and needs as little cacheing as is practical.

The policy for an MKDoc site can be tweaked to suit any such situation, but a basic policy will suffice for all but the most high-traffic situations. The policy is defined in a MKDoc::Control_List file like this:

Feel free to download and customise this default policy for your particular installation.

Installation

Note that MKDoc::Apache_Cache is an all-purpose accelerator for any mod_perl appplication that uses Apache::Registry. These instructions are for the MKDoc CMS, but can easily be customised to suit other software.

You need to retrieve and install MKDoc::Apache_Cache from CPAN, this is a standard perl module and can be installed normally. You may find that additional modules are required depending on your system:

  • Apache

  • MKDoc::Control_List

  • Cache::Cache

  • Test::More

  • Compress-Zlib

Configuration

You now need to configure MKDoc to use the module and the policy.

Download the policy file and place in your MKDoc site directory. Make sure it is readable by the web-server user-account:

/var/www/mkdoc/example.com/cache-policy.txt

Open the httpd-mkdoc.conf file in an editor and locate this line:

PerlHandler Apache::Registry

Replace it with the following lines:

PerlSetEnv  MKDoc_Apache_Cache_CONFIG     /var/www/mkdoc/example.com/cache-policy.txt
PerlSetEnv  MKDoc_Apache_Cache_CACHE_ROOT /var/www/mkdoc/example.com/cache
PerlSetEnv  MKDoc_Apache_Cache_NAMESPACE  apache_cache_gz
PerlHandler MKDoc::Apache_Cache

Adjust the paths as necessary to suit your installation. Restart apache and test your site.

You can check that the cache is in effect for any document by looking at the HTTP response headers, two new headers will be in place:

Etag: f298648cd5372b9616e5445dde5f34e2
Expires: Thu, 26 Aug 2004 20:49:47 GMT

These headers are hints for further downstream caches.

Additional information

You may be interested in following-up the concepts and rationale behind web-cacheing. Mark Nottingham's Caching Tutorial for Web Authors and Webmasters is a good place to start.

<< | Up | >>

This document was last modified by Bruno Postle on 2004-09-29 17:15:55
MKDoc Ltd., 31 Psalter Lane, Sheffield, S11 8YL, UK.
Copyright © 2001-2005 MKDoc Ltd.