Dispatcher No Cache and Internet Explorer Error | Community
Skip to main content
Level 3
October 16, 2015
Solved

Dispatcher No Cache and Internet Explorer Error

  • October 16, 2015
  • 7 replies
  • 1996 views

Hi all,

I am using this line of code: <% response.setHeader("Dispatcher", "no-cache"); %> to prevent caching of some pages on my CQ site. This works very well in Chrome but actually causes a 500 Internal Server Error when using IE. Interestingly, even when setting the standard HTTP no-cache headers (below) we see the same behaviour:

<%
response.setHeader("Cache-Control", "no-cache, no-store, must-revalidate"); // HTTP 1.1.
response.setHeader("Pragma", "no-cache"); // HTTP 1.0.
response.setDateHeader("Expires", 0); // Proxies.
%>

Furthermore, even when setting these headers as meta tags, we see the same server response when hitting the page from IE. Please note that we do not see the problem when accessing the site on the Author instance, only the Publisher. Any thoughts as to what I'm doing wrong will be very much appreciated.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Sham_HC

Have you white listed cookie in optout[1] service?

[1]    http://localhost:4502/system/console/configMgr/com.adobe.granite.optout.impl.OptOutServiceImpl

7 replies

Adobe Employee
October 16, 2015

The server generates a 500 error? Like you see it in the AEM access.log file?

Level 3
October 16, 2015

Yeah, weird right?

Here's a screen shot of the server's reaction...[img]Screen Shot 2014-09-12 at 19.07.56.png[/img]

Adobe Employee
October 16, 2015

That's from Apache (I think). Does this also happen if you hit AEM directly (from IE)?

Level 3
October 16, 2015

Just to add some more context, I have now discovered that the above conflicts with some cookie-based code immediately after it:

<%
  response.setHeader("Dispatcher", "no-cache");
%>


<%

// Check for the existence and value of the log-in cookie
Cookie[] cookies = request.getCookies();

// Boolean to use throughout the comp
Boolean REDACTED1 = false;

// Loop over the available cookies and search for the required one

for(Cookie cookie : cookies){
    // Check the match
    if(null != cookie && cookie.getName().equals("REDACTED") && cookie.getValue().equals("REDACTED")){
    REDACTED1 = true;
    }
}

%>

If I remove the code inside the for loop, it works. Interestingly, ANY code added inside the for loop causes the breakage.

Sham_HC
Sham_HCAccepted solution
Level 10
October 16, 2015
Level 3
October 16, 2015

Yes, Sham, thanks. It is whitelisted. The problem is specific to IE (all versions) not Chrome or Safari.

Sham_HC
Level 10
October 16, 2015

courtthreeGDC wrote...

Yes, Sham, thanks. It is whitelisted. The problem is specific to IE (all versions) not Chrome or Safari.

 


Which version of IE? Does it happen with geometrixx site also?