What is Oscache?
is a high-performance Java EE caching framework that caches part of a JSP or HTTP request and can be cached by any JavaScript object
The cache is stored in the form of key value.
can also be permanently cached: Cache can be written to disk at will
Support Cluster
Using Oscache:
1. Make the required Jar copy Lib
2. Put the Oscache installation directory oscache.properties into the SRC directory
3. Introduction of <% @taglib prefix= "Oscache" uri= "Http://www.opensymphony.com/oscache"%>
4. Page Add cache
<oscache:cache>
Cache time: <%=new date ()%><br/>
</oscache:cache>
Key:http://localhost:8888/oscache_test/?id=1
value:index.jsp
The cache key will consist of the requested url+ query string
The cache is stored by default in the application range, and the cache time defaults to 3,600 seconds and 1 hours
Cons: Data update is not timely
<oscache:cache key= "Name" >
No longer consists of a url+ query string
Global Cache configuration:
<filter> <filter-name> Cachefilter</filter-name> <filter-class >com.opensymphony.oscache.web.filter.CacheFilter</filter-class> <init-param> <param-name>time</param-name> <param-value>5</param-value> </init-param> <init-param> <param-name>scope</param-name> <param-value>application </param-value> </init-param> </filter> < Filter-mapping> <filter-name>cachefilter</filter-name> <url-pattern >*.jsp</url-pattern> </filter-mapping>
Oscache Configuration Properties Introduction
Specify the capacity of the cache: cache.capacity=1000
Whether to use memory cache, default is True:cache.memory=false
If specified due to hard disk cache:
cache.memory=falsecache.capacity=1000cache.path=d:\\cachecache.persistence.class= Com.opensymphony.oscache.plugins.diskpersistence.DiskPersistenceListener
This article is from the "Lao Niu Java" blog, please be sure to keep this source http://liuyj.blog.51cto.com/2340749/1714599
(MAVEN+SSH) online Store project actual combat page Cache Oscache