Hi Martin,
Underneath it all, GWT is using the XmlHttpRequest facility of the browser
as a client.  For GET requests, this is influenced by the caching-related
response information your server resource exposes.  Different browsers have
different rules about how aggressive to be.  Caching-related headers include
"Cache-control," and "Expires."  The ETag header exposed for a resource is
also used by most current browsers to do conditional GET operations in the
future; these may hit your resource and get a 304 Not Modified response.

If you do not ever want clients to cache the representation they GET (and
this goes not just for GWT or XmlHttpRequest, but all user agents
generally), the easiest thing to do is to send a Cache-Control: no-cache
header.

Have a look at this thread for more information and references on
influencing client-side caching and how browsers treat it.

http://www.mail-archive.com/[email protected]/msg06759.html

Restlet's support for influencing caching is not good in 1.1, but some work
on this is underway in 1.2.

- Rob


On Thu, Mar 19, 2009 at 9:43 AM, martin <[email protected]> wrote:

> Hello all,
>
> I have used a GWT restlet client into an existing GWT application with
> success.
>
> My problem is that when I try to access a server resource several times,
> the client actually calls the server only one time!
>
> Let's be -a bit- more precise with the following piece of code:
>
> client.get(uri, new Callback() {
>  public void onEvent(Request request, Response response) {
>   ...
>  }
> );
>
> 1) calling response.getStatus().isError() returns false...
> 2) but calling response.getEntity().getText() allways returns what was
> provided at the first GET request.
>
> On the server side, the Restlet.handle(Request request, Response response)
> is called at the first GET request, and is never called latter.
>
> I tried looking at GWT client code without finding any caching system. May
> that be possible that some default GWT settings infer with the GWT restlet
> client library?
>
> Thanks in advance!
>
> Martin
>
> ------------------------------------------------------
>
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=1355533
>

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=1355684

Reply via email to