On 16 nov, 16:34, magat <mathieu.a...@gmail.com> wrote:
> Hi all,
>
> I'm using a RequestBuilder from com.google.gwt.http.client to update
> informations in my app (calling an external home-made API which I must
> call with http GET).

Doing updates using GET requests is a Bad Thing™, to begin with.

> Everything works just the way I want to, except when using IE8 (and
> maybe other IEs, haven't tested them yet). When in IE, the requests
> are cached, and the server never receives any past the first one.
>
> I found out that this problem is related to the way IE caches Ajax
> requests (someone had the same problem with JQuery here :
> http://stackoverflow.com/questions/1013637/unexpected-caching-of-ajax...).

The workaround was to use "cache: false", which in jQuery adds a
parameter to the query-string (named "_" with the value being the
current timestamp: see 
https://github.com/jquery/jquery/blob/master/src/ajax.js#L268
)

> Unfortunately, asking my users to change the caching params in IE is
> not possible, so I'm trying to solve the problem in the request
> builder itself.
>
> I tried to add http headers to prevent IE from caching the requests :
>
> requestBuilder.setHeader("Cache-Control", "max-age=0,no-cache,no-
> store,post-check=0,pre-check=0");
> requestBuilder.setHeader("Expires", "Mon, 26 Jul 1997 05:00:00 GMT");
>
> But IE ignores them :(
>
> I'm open to every suggestions, thanks for your help !

Have you tried sending aggressive no-cache headers *from the server*?

But the obvious fix would be to not use GET for what it's not meant to.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to