Thanks, I'll try that -- at least you saved me from finding the hack myself :-)
Is there an RFE to vote upon? I think controlling the caches can be quite important, especially if you have lots of small objects. I'd personally even go as far as having a parameter on the constructor of directory that toggles infinite caching. If the resource is truly static with a URI encoding its revision, then you will never need the cache expiry. Peter Rob Heittman wrote: > We still do this: > > http://gogoego.googlecode.com/svn/trunk/modules/com.solertium.util.restlet/src/com/solertium/util/restlet/ClapCacheDirectory.java > > If there's a better way, I'd love to adopt it too. > > On Thu, Feb 19, 2009 at 11:29 PM, Peter Becker <[email protected]> > wrote: >> Hello, >> >> I'm using the CLAP protocol to get static content such as JavaScript >> delivered. I'd like to have those expire way down in the future since I >> use URLs that encode the file version and some of the JS libraries I use >> create quite a few hits to the server. I'm using Restlet 1.1.2 with the >> Restlet engine. >> >> I've tried a number of things, but nothing seems to work. What I am >> currently doing is this: >> >> public static void main(String[] args) throws Exception { >> Component component = new Component(); >> component.getServers().add(Protocol.HTTP, >> configuration.getHttpPort()); >> component.getClients().add(Protocol.CLAP).getContext().getParameters().add("timeToLive","604800"); >> >> component.getDefaultHost().attach(new Pronto()); >> >> component.start(); >> } >> >> and in createRoot() I have a Router to which I attach a directory like >> this: >> >> router.attach("/javascript", >> new Directory(getContext(), >> LocalReference.createClapReference(LocalReference.CLAP_THREAD, >> "/javascript"))); >> >> I can't see any relevant header in the responses, though -- somehow >> setting the parameter doesn't seem to have any impact. Am I missing >> something? >> >> BTW: the "Server" header says "Noelios-Restlet-Engine/1.1..2", which I >> suppose has a dot too many. >> >> Regards, >> Peter >> >> ------------------------------------------------------ >> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=1196339 >> > > ------------------------------------------------------ > http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=1198252 ------------------------------------------------------ http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=1211667

