You are not logged in Log in Join
You are here: Home » Members » andym » File System Cache Manager

Log in
Name

Password

 
 

Folder icon File System Cache Manager

FS Cache Manager

An alternative approach to caching web sites. There are three main ways of caching a web site at the moment, using a HTTP Accelerated Cache Manager, a RAM Cache Manager and using an external proxy to do the caching such as Squid or Apache. This is just another approach, its not exactly a brilliant approach and like all the others its not perfect but it is very fast and easy to set up. For alternatives see the bottom of this page.

How it works.

Whilst exploring with using IIS as a proxy for Zope some people found the ASP 404 script is a whopping 2x as fast as PCGI for IIS. And that got Alan Runyan and I thinking about this. It seemed like a daft way to go but apparently this is how Vignette and some other CMS's approach the problem.

Note: this cache manager requires another web server such as Apache or IIS

  • There is an incoming request to your web server (Apache or IIS).
    • The web server fails to find the page on the file system so proxies to Zope.
    • The object is rendered served back through the proxy. If your object in Zope is assigned to an FSCache it is written to the file system.
  • Next request comes in.
    • Your web server finds the object on the file system and renders it back
    • .. and repeat
  • You change the object in Zope
    • It invalidates the object and deletes from the file system
  • Next request comes in, back to the top...

Setting this up

Obviously this system only works with a web server that gives you this flexibility and you have static pages to render. In IIS use the ASP 404 script as mentioned above. You can do this in Apache using the RewriteCond directive, eg:

RewriteEngine On
DocumentRoot "E:/ZenSkin/FSCache"
RewriteCond E:/ZenSkin/FSCache%{REQUEST_FILENAME} !-f
# file not found so
# do my rewrite as usual
# blah, blah 
RewriteRule ^/(.*) http://books.agmweb.ca:84/... 

Advantages

  • Easy to mix static and dynamic sites
  • Very easy to use
  • You can set caching policy on your objects in Zope
  • Survives reboots, dead zope and so on...

Disadvantages

  • Serving from a memory cache is faster
  • You dont really have control over cache object life.

Installation

  • Ungzip and untar the product into your Zope products directory
  • Restart Zope
  • Add a FSCacheManager, assign objects to it.
  • Changing storage directories must be done on the file system, by altering FSMappings.py. This is done for your security so people can't select a directory for you. Instructions are in FSMappings.py. After altering there you must restart or refresh.

Alternatives

  • Storing your content on the file system and serving it from the web server straight away
  • Using Squid or Apache and setting cache headers on objects and configuring your web server
  • Using sync software such as CMFDeployment, wget and so on.

 Title   Type   Size   Modified   Status 
 File System Cache Manager 0.1 Edit object News Item 1 K 2002-11-18 published
 FS Cache Manager 0.1 Edit object Software Release   2002-11-18 published
 FS Cache Manager 0.2 Edit object Software Release   2002-11-29 published