<!-- 处理静态资源 -->
<!-- 上传的图片缓存1个月,其他js,css,img资源缓存一年 -->
<mvc:resources mapping="/res/**" location="/res/" cache-period="2592000"/>
<mvc:resources mapping="/resources/**" location="/resources/" cache-period="31536000"/>
<mvc:resources mapping="/css/**" location="/css/" cache-period="31536000"/>
<mvc:resources mapping="/js/**" location="/js/" cache-period="31536000"/>
<mvc:resources mapping="/img/**" location="/img/" cache-period="31536000"/>
<mvc:resources mapping="/images/**" location="/images/" cache-period="31536000"/>
cache-period 属性
请求状态为403,不会再次从服务器得到图片,利用了浏览器缓存,节约请求的流量和请求时间。