Re: prevent browser from cahing my pages

2009-09-10 Thread mbrictson

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



Re: prevent browser from cahing my pages

2009-09-10 Thread fachhoch

i tried this it did not work , does it have anything to do with
urlencodingstrategy ?

mbrictson wrote:
 
 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-tp25385725p25387264.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



Re: prevent browser from cahing my pages

2009-09-10 Thread Martin Makundi
 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.

This has got nothing to do with CACHE. It is Wicket's pagemap. If you
hit BACK it loadas the OLD page from PAGEMAP / Page History.

If you want to disable back button there are posts about that...

**
Martin



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



Re: prevent browser from cahing my pages

2009-09-10 Thread mbrictson

I am not sure, but you may want to double-check where the caching is actually
happening, and whether setHeaders() is working.

For example, using Firebug or something simliar you should be able to check
if the browser cache is being used or if it is actually making an HTTP
roundtrip. You should also double-check that the cache-control header is
being sent as you expect.

If the browser isn't caching (i.e. it is getting stale data from the
server), or if the expected cache-control header is not being sent, the
problem might be in your Wicket code or something in between. Some logging
statements or debugging could help narrow down that problem.



fachhoch wrote:
 
 i tried this it did not work , does it have anything to do with
 urlencodingstrategy ?
 
 mbrictson wrote:
 
 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-tp25385725p25387499.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



Re: prevent browser from cahing my pages

2009-09-10 Thread fachhoch

I restarted  firefox and then  it works.Thanks


mbrictson wrote:
 
 I am not sure, but you may want to double-check where the caching is
 actually happening, and whether setHeaders() is working.
 
 For example, using Firebug or something simliar you should be able to
 check if the browser cache is being used or if it is actually making an
 HTTP roundtrip. You should also double-check that the cache-control header
 is being sent as you expect.
 
 If the browser isn't caching (i.e. it is getting stale data from the
 server), or if the expected cache-control header is not being sent, the
 problem might be in your Wicket code or something in between. Some logging
 statements or debugging could help narrow down that problem.
 
 
 
 fachhoch wrote:
 
 i tried this it did not work , does it have anything to do with
 urlencodingstrategy ?
 
 mbrictson wrote:
 
 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-tp25385725p25387730.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