4 Replies Latest reply on May 27, 2013 7:12 PM by rickyw913

    Cannot re-cache files through invalidate.cache

    rickyw913

      I have followed the instructions described in http://dev.day.com/docs/en/cq/5-5/deploying/dispatcher/page_invalidate.html to manually delete and re-cache files. However, I found that I can only delete cache files but not to re-cache files immediately.

       

      Below is the code I used to perform the test:

       

              HttpClient client = new HttpClient();

              PostMethod post = new PostMethod("http://localhost/dispatcher/invalidate.cache");

              post.setRequestHeader("CQ-Action", "Activate");

              post.setRequestHeader("CQ-Handle",  "/content/geometrixx/en" );

       

       

              StringRequestEntity body = new StringRequestEntity( "/content/geometrixx/en.html" , null, null);

              post.setRequestEntity(body);

              post.setRequestHeader("Content-length",String.valueOf(body.getContentLength()));

              client.executeMethod(post);

              post.releaseConnection();

       

      After the code is run, I found that cache files in Dispatcher are removed, but they have not been re-created. Below is the captured from dispatcher log:

       

      [Sun May 26 14:00:28 2013] [D] [2488(1372)] Found farm website for localhost

      [Sun May 26 14:00:28 2013] [D] [2488(1372)] checking [/dispatcher/invalidate.cache]

      [Sun May 26 14:00:28 2013] [I] [2488(1372)] Activation detected: action=Activate [/content/geometrixx/en]

      [Sun May 26 14:00:28 2013] [I] [2488(1372)] Touched \opt\communique\dispatcher\cache\.stat

      [Sun May 26 14:00:28 2013] [I] [2488(1372)] Evicted \opt\communique\dispatcher\cache\content\geometrixx\en.html

      [Sun May 26 14:00:28 2013] [I] [2488(1372)] Evicted \opt\communique\dispatcher\cache\content\geometrixx\en.topnav.1369537660795.html

      [Sun May 26 14:00:28 2013] [I] [2488(1372)] Evicted \opt\communique\dispatcher\cache\content\geometrixx\en\_jcr_content\par\image.img.jpg\136 8263491134.jpg

      [Sun May 26 14:00:28 2013] [I] [2488(1372)] Evicted \opt\communique\dispatcher\cache\content\geometrixx\en\_jcr_content\par\image.img.jpg

      [Sun May 26 14:00:28 2013] [I] [2488(1372)] Evicted \opt\communique\dispatcher\cache\content\geometrixx\en\_jcr_content\par\image_0.img.jpg\1 368263491152.jpg

      [Sun May 26 14:00:28 2013] [I] [2488(1372)] Evicted \opt\communique\dispatcher\cache\content\geometrixx\en\_jcr_content\par\image_0.img.jpg

      [Sun May 26 14:00:28 2013] [I] [2488(1372)] Evicted \opt\communique\dispatcher\cache\content\geometrixx\en\_jcr_content\par

      [Sun May 26 14:00:28 2013] [I] [2488(1372)] Evicted \opt\communique\dispatcher\cache\content\geometrixx\en\_jcr_content

      [Sun May 26 14:00:28 2013] [D] [2488(1372)] response.headers[Server] = "Communique/2.6.3 (build 5221)"

      [Sun May 26 14:00:28 2013] [D] [2488(1372)] cache flushed

      [Sun May 26 14:00:28 2013] [I] [2488(1372)] "POST /dispatcher/invalidate.cache" 0 13 31ms

       

      May I know whether I missed anything or if there is any specific configuration / setup I need to do to make this work?