Expiry Headers for static resources in Java Webapps
is there a way to configure Expires
headers for static resources in a Java Webapplication without having to use a servlet/controller to do the job? The reason is, that we have a bunch of static CSS, Images, and JavaScript files that will only rarely change (if at all).
Of course I could just write a Controller for those resources (and I probably will, if there is no alternative), but since this is a recurring problem I wonder if there might already be a solution out there.
PS: Since we use the Spring framework a开发者_如何学Gonyway, a solution from there is ok too.
Yes do it using Filter, configure a filter that will intercept each static resources's request and in response modify header.
精彩评论