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.
Solved! Go to Solution.
Views
Replies
Total Likes
Have you white listed cookie in optout[1] service?
[1] http://localhost:4502/system/console/configMgr/com.adobe.granite.optout.impl.OptOutServiceImpl
Views
Replies
Total Likes
The server generates a 500 error? Like you see it in the AEM access.log file?
Views
Replies
Total Likes
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]
Views
Replies
Total Likes
That's from Apache (I think). Does this also happen if you hit AEM directly (from IE)?
Views
Replies
Total Likes
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.
Views
Replies
Total Likes
Have you white listed cookie in optout[1] service?
[1] http://localhost:4502/system/console/configMgr/com.adobe.granite.optout.impl.OptOutServiceImpl
Views
Replies
Total Likes
Yes, Sham, thanks. It is whitelisted. The problem is specific to IE (all versions) not Chrome or Safari.
Views
Replies
Total Likes
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?
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies