Hello all
What is the best way to set up caching on tomcat?
Also how is caching functions?Is it url based,dir based or what?
I need url specific caching so the database don't make the same calculations for the same url's
Hello all
What is the best way to set up caching on tomcat?
Also how is caching functions?Is it url based,dir based or what?
I need url specific caching so the database don't make the same calculations for the same url's
The simplest way, is to use a dedicated web cache provider. Tomcat does not have one OOTB, but you could employ Apache with mod_cache (and obviously mod_jk). In this configuration, Apache tends to act as a proxy-cache that caches the dynamic content served by Tomcat; you will have to ensure that Tomcat serves the right headers to ensure that Apache will cache the responses.
There are other commerical web-cache solutions, but they're typically used for high-end uses.
You could also employ Squid instead of Apache, to act as a reverse proxy that is also capable of serving cached content; in this case, Squid performs caching of the dynamic content.
If you do not wish to invest in an additional server, like the above solutions suggest, you might consider using EHCache to perform web page caching on Tomcat itself.
Related
Tomcat doesn't support what you want out of the box, so you'll need some extra stuff. I'm not fully aware of all mod_cache
capabilities but if you're not using Apache, OSCache can do what you're requesting.