nfechner
nfechner

Reputation: 17535

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 anyway, a solution from there is ok too.

Upvotes: 0

Views: 283

Answers (1)

Jigar Joshi
Jigar Joshi

Reputation: 240948

Yes do it using Filter, configure a filter that will intercept each static resources's request and in response modify header.

Upvotes: 3

Related Questions