You could add a shared resource to your application, like this: Application.get().getSharedResources().add(<name>, <WebResource>)... in the WebResource implementation you can control the response headers by adding expire headers or etag.. This is pretty clean approach.
Alex Objelean Fernando Wermus-2 wrote: > > Hi all, > I am testing an app in production and I have reached a problem you may > help solve me. Like the war files were big, I decided to move all static > images to a folder in production and add the following code to my > Applicacion class. > > mount(new URIRequestTargetUrlCodingStrategy("/images") { > > @Override public IRequestTarget decode(RequestParameters > requestParameters) > { > > try { > > return serveStaticImages(getURI(requestParameters), ....); > > } catch (Exception e) { > > throw new WicketRuntimeException(e); > > } > > } > > }); > > The problem is that each time that someone calls a page, all the images > are > downloaded again. I know this isnt the best aproach and actually, it is > awful in practices because of this issue. Why isnt caching the images and > which would be the best approach? > > Thanks in advance > > > -- > Fernando Wermus. > > www.linkedin.com/in/fernandowermus > > -- View this message in context: http://www.nabble.com/images-not-cached-tp26087246p26089989.html Sent from the Wicket - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org