Is Apache sends "X-Cache:MISS" header even when caching is off (disable)?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • anukedari
    New Member
    • Jul 2007
    • 5

    Is Apache sends "X-Cache:MISS" header even when caching is off (disable)?

    Hi,

    Could any boby please help to get the answers for the following questions:

    Is Apache always sends "X-Cache:MISS" header even when caching is off (disable)? or

    Can we say that cache settings are enable if it sends "X-Cache:MISS" header in the response?

    Your help would be appreciated.

    Thanks
    Anu
  • Motoma
    Recognized Expert Specialist
    • Jan 2007
    • 3236

    #2
    You could try experimenting, however, I would not expect Apache to report any cache information if caching was not configured in the first place.

    Comment

    • anukedari
      New Member
      • Jul 2007
      • 5

      #3
      "X-Cache:MISS&quot ; header is the normal behaviour in Reponse even if the cache settings a

      You mean that the "X-Cache:MISS" header is the normal behaviour in Reponse even if the cache settings are disabled in Apache??

      I assume cache settings are disabled in my Apache by seeing the following lines in httpd.conf

      # To enable the cache as well, edit and uncomment the following lines:
      # (no cacheing without CacheRoot)
      #
      # CacheRoot "/var/apache/proxy"
      # CacheSize 5
      # CacheGcInterval 4
      # CacheMaxExpire 24
      # CacheLastModifi edFactor 0.1
      # CacheDefaultExp ire 1
      # NoCache a-domain.com another-domain.edu joes.garage-sale.com


      Your help would be appreciated
      Last edited by anukedari; Jul 11 '07, 10:02 AM. Reason: .

      Comment

      • Motoma
        Recognized Expert Specialist
        • Jan 2007
        • 3236

        #4
        I am not sure what help you are looking for. Please elaborate on the issue you are having, as I am afraid your questions are not producing useful answers.

        Comment

        • anukedari
          New Member
          • Jul 2007
          • 5

          #5
          Hi,

          I think below information will give the clear picture.

          Following is the request and response (I used SOAPUI for webservice request and response):


          Request :-
          POST http://ukdiscoverywste st.gsk.com/ChemicalHierarc hy/services/ChemicalHierarc hyServiceV1 HTTP/1.1
          Content-Type: text/xml;charset=UTF-8
          SOAPAction: "getServiceInfo "
          User-Agent: Jakarta Commons-HttpClient/3.0.1
          Host: ukdiscoverywste st.gsk.com
          Proxy-Connection: Keep-Alive

          Response:-
          HTTP/1.1 200 OK
          Date: Mon, 11 Jun 2007 15:14:53 GMT
          Server: Apache-Coyote/1.1
          X-Powered-By: Servlet 2.4; JBoss-4.0.2 (build: CVSTag=JBoss_4_ 0_2 date=2005050220 23)/Tomcat-5.5
          Content-Type: text/xml;charset=utf-8
          Via: 1.1 ukdiscoverywste st.gsk.com (Apache/1.3.31)
          X-Cache: MISS from ukdiscoverywste st.gsk.com
          Transfer-Encoding: chunked


          its just that "Cache miss" makes me concerned that caching is actually still turned on. If you confirm that it always sends that header, even when caching is off, then I'd consider this problem is solved.

          Thanks
          Anu

          Comment

          • Motoma
            Recognized Expert Specialist
            • Jan 2007
            • 3236

            #6
            Why not just add a no-cache specifier in your request?
            I believe the syntax is:

            Pragma: no-cache

            Comment

            • anukedari
              New Member
              • Jul 2007
              • 5

              #7
              Thanks for your interest.

              In one of the servlet the following lines are hard coded

              response.setCon tentType("text/xml; charset=utf-8");
              response.setCon tentLength(tran slated.length() );
              response.setHea der("Expires", "Sat, 6 May 1995 12:00:00 GMT");
              response.setHea der("Cache-Control", "no-store, no-cache, must-revalidate");
              response.addHea der("Cache-Control", "post-check=0, pre-check=0");
              response.setHea der("Pragma", "no-cache");


              Apache (Version: 1.3.31) is not allowed to add "Pragma:no-cache" in httpd.conf file.

              Please let me know whether "X-Cache:MISS" is normal behaviour or abnormal?
              What is the negative impact of this header?

              Comment

              • Motoma
                Recognized Expert Specialist
                • Jan 2007
                • 3236

                #8
                If you are sending Pragma: No-Cache in the request, you do not need to worry about receiving cached data.

                Comment

                • anukedari
                  New Member
                  • Jul 2007
                  • 5

                  #9
                  Many Thanks , Now I am bit relief.

                  Please let me know why "X-Cache:MISS" header comes even though Cache settings are disabled in Apache?

                  Comment

                  Working...