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:
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