This works for me:

    @Override
    protected void setHeaders(WebResponse response)
    {
        response.setHeader("Pragma", "no-cache");
        response.setHeader(
            "Cache-Control",
            "no-cache, max-age=0, must-revalidate, no-store"
        );
    }

"no-store" is needed to prevent Firefox from caching the back-button.



fachhoch wrote:
> 
> I want to add nocache header to my pages ,
> 
> code from WebPage
> 
>         response.setHeader("Pragma", "no-cache");
>         response.setHeader("Cache-Control", "no-cache, max-age=0,
> must-revalidate"); // no-store
> 
> 
> and I also added
> 
>         response.setHeader("Cache-Control","no-cache");
>         response.setDateHeader ("Expires", -1);
> by overriding
>    @Override
>     protected void setHeaders(WebResponse response) {
>         super.setHeaders(response);
>         response.setHeader("Cache-Control","no-cache");
>         response.setDateHeader ("Expires", -1);
>     }
> 
> 
> but the browser is still caching the pages , I hit the back button or
> forward button the page is not refreshed , please tell me how   to prevent
> browser from chaching my pages.
> 
> 

-- 
View this message in context: 
http://www.nabble.com/prevent-browser-from-cahing-my-pages-tp25385725p25386585.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to