proxy caching


what are the configuration needs to be made in tomcat (7,8) server for enabling proxy caching?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd 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 commercial 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.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
RockingAuthor Commented:
how to configure the setting in apache with tomcat for proxy caching?
Let me know the steps for the above.
I'm not a sys-admin so I can't give you detailed advice, but in general for tools like Squid, the configuration you need to focus on happens in the proxy.  Tomcat generally doesn't need to be changed.

When a new request comes in it goes to Squid.  If Squid has a cached copy it responds with the cached version.  If not it forwards the request to Tomcat, which just responds exactly as if the request had come directly from the end user.

So you need to figure out how to install and configure whatever proxy you wish to use.
You might want to try "Squid in 5 mins":

Also there are a lot of commercial solutions available for this - where the proxy/caching layer happens using another company's servers.  Some of the big players are Edgecast ( and Akamai ( or if you would like a cheap/free solution consider CloudFlare (  If you use one of these, they handle all of the proxy servers and their configuration.  You just need to do some very simple setup (usually just creating some DNS entries) and each service has lots of docs or people to help walk you through it.

RockingAuthor Commented:
I am unable to find enabling proxy caching in apache and tomcat?
Any link would be very much appreciated.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.