3 Replies Latest reply on Oct 11, 2012 12:00 PM by Jörg Hoh

    Dispatcher serving, but not caching, CQ5 pages

    MichaelOryl Level 1

      Just restored a backup of a CQ5.5 staging server to a new Amazon EC2 instance in order to allow some people outside of the company shared access to what we are working on.  CQ5 appears to be running correctly for the author and publish instances; I can see our site.

       

      But the dispatcher in Apache is having trouble caching files, it seems.  Apache can serve the URLs requested of it, but it fails to cache any of them, so that every requested is actually being serviced by the publish instance through the dispatcher.  This is the dispatcher log showing the problem:

       

      [Thu Oct 11 17:58:58 2012] [D] [820(139934505617152)] Found farm pmlpublic for ec2-174-129-90-184.compute-1.amazonaws.com

      [Thu Oct 11 17:58:58 2012] [D] [820(139934505617152)] checking [/content/public/individuals-families/financial-life/planning-strategies.html]

      [Thu Oct 11 17:58:58 2012] [D] [820(139934505617152)] no cache due to authorization header.

      [Thu Oct 11 17:58:58 2012] [D] [820(139934505617152)] cache-action for [/content/public/individuals-families/financial-life/planning-strategies.html]: NONE

      [Thu Oct 11 17:58:58 2012] [D] [820(139934505617152)] connected to render rend01 (localhost:4503)

      [Thu Oct 11 17:58:58 2012] [D] [820(139934505617152)] Spooling header: Host

      [Thu Oct 11 17:58:58 2012] [D] [820(139934505617152)] Spooling header: Cache-Control

      [Thu Oct 11 17:58:58 2012] [D] [820(139934505617152)] Spooling header: User-Agent

      [Thu Oct 11 17:58:58 2012] [D] [820(139934505617152)] Spooling header: Accept

      [Thu Oct 11 17:58:58 2012] [D] [820(139934505617152)] Spooling header: Referer

      [Thu Oct 11 17:58:58 2012] [D] [820(139934505617152)] Spooling header: Accept-Encoding

      [Thu Oct 11 17:58:58 2012] [D] [820(139934505617152)] Spooling header: Accept-Language

      [Thu Oct 11 17:58:58 2012] [D] [820(139934505617152)] Spooling header: Accept-Charset

      [Thu Oct 11 17:58:58 2012] [D] [820(139934505617152)] Spooling header: Cookie

      [Thu Oct 11 17:58:58 2012] [D] [820(139934505617152)] Spooling header: Via

      [Thu Oct 11 17:58:59 2012] [D] [820(139934505617152)] Detected: chunked transfer encoding

      [Thu Oct 11 17:58:59 2012] [D] [820(139934505617152)] response.status = 200

      [Thu Oct 11 17:58:59 2012] [D] [820(139934505617152)] response.headers[Server] = "Day-Servlet-Engine/4.1.24 "

      [Thu Oct 11 17:58:59 2012] [D] [820(139934505617152)] response.headers[Content-Type] = "text/html;charset=UTF-8"

      [Thu Oct 11 17:58:59 2012] [D] [820(139934505617152)] response.headers[Date] = "Thu, 11 Oct 2012 17:58:59 GMT"

      [Thu Oct 11 17:58:59 2012] [D] [820(139934505617152)] response.headers[Set-Cookie] = "JSESSIONID=e4bb6232-7726-4258-a724-f111ccf0eed9; Path=/; HttpOnly"

      [Thu Oct 11 17:58:59 2012] [D] [820(139934505617152)] send http headers

      [Thu Oct 11 17:58:59 2012] [D] [820(139934505617152)] Content length: -1, written: 54000

      [Thu Oct 11 17:58:59 2012] [I] [820(139934505617152)] "GET /content/public/individuals-families/financial-life/planning-strategies.html" 200 53979 330ms


      That "cache-action: NONE" is the issue.

       

      I've checked permissions in the cache directory, and they match those of our staging servers - best I can tell.  But nothing ever gets written to disk for caching.

       

      I'm guessing that I am missing something obvious, and my gut tells me I've dealth with this before, but I just can't get it going.  Any ideas?

        • 1. Re: Dispatcher serving, but not caching, CQ5 pages
          Scott Brodersen Adobe Employee

          This is the issue I think:

           

          [Thu Oct 11 17:58:58 2012] [D] [820(139934505617152)] no cache due to authorization header.

           

          By default, if the HTTP request includes an authorization header, the cache is not used. There is a property in the dispatcher.any file:

           

          /allowAuthorized

          By default, requests that carry an authentication header are not cached. This is because authentication is not checked when a document is returned from the cache - so the document would be displayed for a user who does not have the necessary rights. However, in some setups it can be permissible to cache authenticated documents

           

          This is from http://dev.day.com/docs/en/cq/current/deploying/dispatcher.html#Configuration Parameters

           

          scott

           

           


          • 2. Re: Dispatcher serving, but not caching, CQ5 pages
            MichaelOryl Level 1

            Well, it seems that you are at least somewhat right, in spite of what I thought to be the case.

             

            While I am not authenticated in Apache or the website itself, I am authenticated in my browser because I was logged into the CQ5 admin through the same domain.  That seems to be the issue.  When I request pages from a different browser, that has no login-token cookie, the pages are cached by the dispatcher.

             

            That seems a bit strange to me, but using a different browser (or logging out of the admin site) does the trick.

             

            The behavior seems to be that if you are authenticated on the domain at all, then no pages you request will be cached.  That seems like overkill to me, but at least I understand what's going on.

             

            Thanks.

             

            Thanks.

            • 3. Re: Dispatcher serving, but not caching, CQ5 pages
              Jörg Hoh Adobe Employee

              That's because of the Basic Auth header, which is sent along with every request made to a domain, where it was requested once.

               

              Jörg