Storing cached data outside the servlet context.

In some cases you might want FSI Cache to use an arbitrary directory to store the cached image server contents. As FSI Cache makes use of Tomcats ability to deliver static contents this cannot be achieved purely by changing the FSI Cache configuration but implies changing tomcats default configuration. The quickest way is to use a symbolic link. Navigate to FSI Caches WEB-INF directory, delete the existing subdirectory called ‘cache’ and create a link to the new cache directory, e.g.:
ln -s /path/to/cache/dir cache
In its default configuration Tomcat is not allowed to follow symbolic links, so you will have to explicitly allow that. To do so, open the ‘context.xml’ in Tomcats main ‘conf’-directory and find the opening tag. Add the allowLinking attribute witha value of ‘true’.
Save the file and restart the Tomcat. From now on the cached data will be stored in and served from the external directory.

Posted in: