proxy caching

Posted on 2014-08-21
Last Modified: 2014-09-25

what are the configuration needs to be made in tomcat (7,8) server for enabling proxy caching?
Question by:Rocking
    LVL 13

    Accepted Solution

    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.

    Author Comment

    how to configure the setting in apache with tomcat for proxy caching?
    Let me know the steps for the above.
    LVL 26

    Expert Comment

    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.


    Author Comment

    I am unable to find enabling proxy caching in apache and tomcat?
    Any link would be very much appreciated.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Suggested Solutions

    If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
    Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
    This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
    The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now