FYI, the RFE related to improved caching headers support is:

"Support caching HTTP headers"
http://restlet.tigris.org/issues/show_bug.cgi?id=213
 
Best regards,
Jerome Louvel
--
Restlet ~ Founder and Lead developer ~ http://www.restlet.org
Noelios Technologies ~ Co-founder ~ http://www.noelios.com


-----Message d'origine-----
De : Rob Heittman [mailto:[email protected]] 
Envoyé : jeudi 19 mars 2009 17:34
À : [email protected]
Objet : Re: Re: Hidden cache in GWT client?

You must use the non-standard header updating mechanism to manipulate
Cache-Control:

Form headers = (Form)
response.getAttributes().get("org.restlet.http.headers");
if (headers == null) {
  headers = new Form();
  response.getAttributes().put("org.restlet.http.headers", headers); }
headers.add("Cache-Control", "no-cache");

This mechanism works fine, but it's kind of verbose -- and you get a warning
from Restlet 1.1, which you can ignore.  There isn't an easy
message.setCacheControl(CacheControl.NO_CACHE) or some such method built
into Restlet yet.

- Rob

On Thu, Mar 19, 2009 at 11:54 AM, martin <[email protected]> wrote:
>
> Hi Rob,
>
> Thanks for your remarks!
>
> I tried to add an attribute "Cache-Control" with value "no-cache" both on
the server response and the client request:
>
> // Server
>
> Restlet situation = new Restlet() {
> �...@override
>  public void handle(Request request, Response response) {
>  ...
>  response.setEntity(kml,MediaType.TEXT_XML);
>  Map<String,Object> map = new HashMap<String,Object>();
>  map.put("Cache-Control", "no-store");
>  response.setAttributes(map);
>  }
> };
>
>
> // Client
> ...
> request.setAttributes(map);
>
> But nothing changed!
>
> Please note that I only encountered this problem when running the GWT
client from hosted mode. When I browse the same URI through the Firefox
navbar, I have no caching problem, and the appropriate document version is
displayed.
>
> By the way, what do you mean by "caching is not good in 1.1"? I am 
> actually using this version of restlet and would like to avoid 
> changing version right now :)
>
> Martin

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

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

Reply via email to