java - Add an Expires or a Cache-Control header in JSP -
How do you add a ending
or cache-control
header? In? I would like to add an end-of-future expiration date for my static components such as images, CSS, and javascript files.
In this way you do not need to copy it on all JSP pages and they are cluttered with scriptlets To enable browser cache, add static components such as CSS and JS to a common folder such as / static or
/ resources Create
Filter , which is mapped on
url-pattern
/ static / * or
/ resource / * and basically nim Not
doFilter () Method:
httpResponse.setDateHeader ( ">
Comments
Post a Comment