Hello,

could you check the headers sent between the client and servers, using, for
example, the LiveHttpHeaders extension for Firefox (
https://addons.mozilla.org/fr/firefox/addon/live-http-headers/)?
Just for a matter of simplification, you can write your code as follow:
resp.getCacheDirectives().add(CacheDirective.noCache());

best regards,
Thierry Boileau
ps : I send you a copy of such headers, obtained in my case with a simple
application. The response contains the right header ("Cache-Control:
no-cache ").

http://localhost:8182/test/cached

GET /test/cached HTTP/1.1
Host: localhost:8182
User-Agent: Mozilla/5.0 (X11; U; Linux i686; fr; rv:1.9.2.16) Gecko/20110323
Ubuntu/10.10 (maverick) Firefox/3.6.16
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: fr,fr-fr;q=0.8,en;q=0.5,en-us;q=0.3
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive

HTTP/1.1 200 OK
Cache-Control: no-cache
Date: Fri, 22 Apr 2011 06:51:39 GMT
Accept-Ranges: bytes
Server: Restlet-Framework/@major-number@.@minor-number@@release-type@
@release-number@
Vary: Accept-Charset, Accept-Encoding, Accept-Language, Accept
Content-Length: 14
Content-Type: text/plain; charset=UTF-8


I am using Restlet framework. Firefox seems to cache the responses sent to
> the browser. I am explicitly specifying that the response should not be
> cached as follows - however it does not seem to get picked up and the
> response ends up getting cached. Any suggestions are appreciated.
>
> List <CacheDirective> cd = new ArrayList <CacheDirective> ();
> cd.add (CacheDirective.noCache ());
> resp.setCacheDirectives (cd);
>
> ------------------------------------------------------
>
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2722235
>

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

Reply via email to