[ 
https://issues.apache.org/jira/browse/WICKET-3921?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13071670#comment-13071670
 ] 

Martin Grigorov commented on WICKET-3921:
-----------------------------------------

Index: wicket/src/main/java/org/apache/wicket/protocol/http/WebResponse.java
===================================================================
--- wicket/src/main/java/org/apache/wicket/protocol/http/WebResponse.java       
(revision 1146974)
+++ wicket/src/main/java/org/apache/wicket/protocol/http/WebResponse.java       
(working copy)
@@ -312,6 +312,9 @@
                // Set content type based on markup type for page
                setCharacterEncoding(encoding);
                setContentType("text/xml; charset=" + encoding);
+               setHeader("Expires", "Mon, 26 Jul 1997 05:00:00 GMT");
+               setHeader("Cache-Control", "no-cache, must-revalidate");
+               setHeader("Pragma", "no-cache");
        }

Here is the possible fix.
WebResponse#redirect() is called not only when 
AjaxRequestTarget.addComponent(Page) is used but also when setResponsePage() is 
used in Ajax request.

The fix is similar for 1.5.

> No HTTP response cache headers are set in Wicket Ajax redirects
> ---------------------------------------------------------------
>
>                 Key: WICKET-3921
>                 URL: https://issues.apache.org/jira/browse/WICKET-3921
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-core
>    Affects Versions: 1.4.17
>            Reporter: Timo Weber
>            Priority: Minor
>
> Usually HTTP response cache headers are being set in AjaxRequestTarget for 
> Ajax responses. But for redirects, the handling is done in WebResponse where 
> no cache headers are being set, which could lead to some trouble.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to