[
https://issues.apache.org/jira/browse/WICKET-3921?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13068871#comment-13068871
]
Timo Weber commented on WICKET-3921:
------------------------------------
It's probably easier for me to give you an entry point.
Method respond(:RequestCycle) in AjaxRequestTarget does part of the response
handling. If the page itself hasn't been added to the request target,
everything's fine. The cache headers will be set to make sure that the response
won't be cached by the browser (line 570-572 in AjaxRequestTarget).
But if the page has been added, the handling is done by
WebResponse.redirect(String url). This ajax redirect isn't performed as an HTTP
redirect (some 30x code) but with the code 200 and the content
"<ajax-response><redirect><![CDATA[" + url + "]]></redirect></ajax-response>"
that is being interpreted by wicket-ajax in the browser. This response doesn't
get any cache headers. Because of that it may be cached by the browser. As the
payload contains a stateful url, this constellation could very likely be
troublesome in some situations leading to obscure errors.
I'd suggest that - if you also think, that it is a bug - you set these cache
headers in a more central place for all ajax responses,
WebRequestCycle.onEndRequest() would be a possible solution. That's where we
put our workaround for now.
Regards, Timo
> 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