I have written a Restlet Web Service and a (Restlet) Client and my own Cache solution on the client. The server is very simple, only example code from restlet.org
My client does a GET for a resource, the server sends back a Representation and the "Expires" Header is set. My client use the Representation from the Cache for a specific time because of the "Expires" Header. Fine :) Later (after the Expires Timestamp) the client does a Conditional GET for the resource in order to see if the resource was changed. I see in Wireshark the "If-Modified-Since" header. Fine :) I can set the status on the server to Status.REDIRECTION_NOT_MODIFIED (304) for the response. I do not have to send back the respresentation. I say only, that it is valid. Fine :) But now the client doesn't know how long he can use his representation. After a Conditional GET i want to say the client, that his representation should be used for a specific time again, because it is valid. The Client should use the representation from his cache for a specific time and after that he should do a Conditional GET again. This is why i want to set the Expires Header after a Conditional GET. I could not set the Expires Header on the server, because this is only possible if i use a Representation for the Response. (If i want to send back a representation with REDIRECTION_NOT_MODIFIED, the Expires Header is not set in the restlet server (i see it in Wireshark), but it works if i do a "normal" GET. I tried to set the header via getAttributes() but after that a warning appeared, that i have to set the "Expires" Header via the restlet method (setExpirationDate()). I can set my own Header "ExpiresWorkaround" and it works, but i can not set the "Expires" Header. What should i do? (or is it wrong to set the Expires Header after a conditional GET, but then what should i do to get the above behaviour?) Thank you very much. ------------------------------------------------------ http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2423065

