springmvc
2016-06-06 14:34
363 查看
<!-- 处理静态资源 --> <!-- 上传的图片缓存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,不会再次从服务器得到图片,利用了浏览器缓存,节约请求的流量和请求时间。
相关文章推荐
- Ubuntu 16.04 火狐添加java插件、解决Firefox强制低版本java插件运行以及安全设置限制自签名应用程序运行
- Spring Boot的Profile切换方式
- 用spring的InitializingBean的afterPropertiesSet来初始化
- 栈与堆的区别
- Spring AOP时的问题
- [LeetCode][6]ZigZag Conversion解析与特殊解法 -Java实现
- Spring AOP 学习(一) 代理模式
- Java泛型
- java中Scanner的hasNext()的疑问
- Java配置文件读取和路径设置
- 从网页上考的代码考到eclipse里面,会出现每行开头的空格下面有红色异常提示,为什么?
- spring mvc中jsp不能访问的原因
- JAVA集合中的迭代器的遍历
- java线程安全总结
- spring4+springmvc+mybatis
- 如何获取Android SHA1,MD5值(Android Studio,Eclipse)?
- java生成二维码
- Version of activiti database (5.15.1) is more recent than the engine (5.14)
- Eclipse设置
- java生成短链接