1、web.xml配置
<!-- oscache缓存 -->
<filter><filter-name>cacheFilter</filter-name>
<filter-class>com.opensymphony.oscache.web.filter.CacheFilter</filter-class>
<init-param>
<param-name>scope</param-name>
<param-value>application</param-value>
</init-param>
<init-param>
<param-name>time</param-name>
<param-value>300</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>cacheFilter</filter-name>
<url-pattern>/rest/space/new</url-pattern>
<url-pattern>/rest/space/resource/newest</url-pattern>
</filter-mapping>
2、oscache.properties
cache.memory=true
cache.persistence.class=com.opensymphony.oscache.plugins.diskpersistence.DiskPersistenceListener
cache.path=D\:\\cache
3、jar 包
oscache-2.4.1.jar