Dashboard > blojsom > ... > Developers Guide > Enabling Caching
  blojsom Log In   View a printable version of the current page.  
  Enabling Caching
Added by David Czarnecki, last edited by David Czarnecki on Jan 19, 2007  (view change)
Labels: 
(None)

OSCache is a package to allow dynamic content to be cached. It is the basis of the caching fetcher in blojsom which will cache blog entries in memory for faster serving of pages.

Installing the Caching Fetcher

You must download the blojsom add-on bundle. It is available as a separate download with each release of blojsom.

  • Unpack the add-on bundle ZIP file. You will need to copy the blojsom-addon-core-version.jar file to your blojsom installation's /WEB-INF/lib directory.
  • Copy the oscache-2.1.jar file to your blojsom installation's /WEB-INF/lib directory.
  • Copy the oscache.properties file to your blojsom installation's /WEB-INF/ directory.
  • For information on configuring various OSCache options, please see their documentation.
  • Change the blojsom-fetcher property in the /WEB-INF/blojsom.properties file to the following.

    blojsom-fetcher=org.blojsom.fetcher.CachingFetcher

  • You must restart your server for blojsom to start using the caching fetcher.

Configuring the Caching Fetcher

By default, the caching fetcher will configure OSCache using the /WEB-INF/oscache.properties file. If you need to change the location of this file, you can configure the oscache-properties initialization parameter in your /WEB-INF/web.xml file in the elements for the blojsom servlet. For example:

<init-param>
    <param-name>oscache-properties</param-name>
    <param-value>/WEB-INF/oscache.properties</param-value>
</init-param>

The default cache time for entries in the cache is 5 minutes. The cache time is a user-configured option in an individual's /WEB-INF/(blog-id)/blog.properties file.

caching-fetcher-refresh={cache time in seconds}

For example, the following would set the refresh period to 10 minutes.

caching-fetcher-refresh=600

Site running on a free Atlassian Confluence Open Source Project License granted to blojsom. Evaluate Confluence today.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.5.4 Build:#809 Jun 12, 2007) - Bug/feature request - Contact Administrators