<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    posts - 14,  comments - 37,  trackbacks - 0
          適用oscache進行jsp的緩存是很好的選擇,但是在開發階段oscache需要禁用,而在生產環境上就可以適用oscache進行jsp緩存了.
          配置oscache很簡單,只需要將oscache-2.3.2.jar加入工程的lib下,然后在web.xml中寫入:
          
    <filter>
            
    <filter-name>cacheFilter</filter-name>
            
    <filter-class>
                com.opensymphony.oscache.web.filter.CacheFilter
            
    </filter-class>
        
    </filter>
        
    <filter-mapping>
            
    <filter-name>cacheFilter</filter-name>
            
    <url-pattern>*.jsp</url-pattern>
        
    </filter-mapping>
          然后再創建一個配置文件oscache.properties,內容如下:
          
    # MR: I have not customized this file at all, it's just the default oscache.properties
    # from the 
    2.0.1 download.

    # CACHE IN MEMORY
    #
    # If you want to disable memory caching
    , just uncomment this line.
    #
    # cache.memory
    =false


    # CACHE KEY
    #
    # This is the key that will be used to store the cache in the application
    # and session scope.
    #
    # If you want to set the cache key to anything other than the default
    # uncomment this line and change the cache.key
    #
    # cache.key
    =__oscache_cache


    # USE HOST DOMAIN NAME IN KEY
    #
    # Servers for multiple host domains may wish to add host name info to
    # the generation of the key.  If this is true
    , then uncomment the
    # following line.
    #
    # cache.use.host.domain.in.key
    =true


    # CACHE LISTENERS
    #
    # These hook OSCache events and perform various actions such as logging
    # cache hits and misses
    , or broadcasting to other cache instances across a cluster.
    # See the documentation for further information.
    #
    # cache.event.listeners
    =com.opensymphony.oscache.plugins.clustersupport.JMSBroadcastingListener,  \
    #                       com.opensymphony.oscache.extra.CacheEntryEventListenerImpl
    ,               \
    #                       com.opensymphony.oscache.extra.CacheMapAccessEventListenerImpl
    ,           \
    #                       com.opensymphony.oscache.extra.ScopeEventListenerImpl


    # CACHE PERSISTENCE CLASS
    #
    # Specify the class to use for persistence. If you use the supplied DiskPersistenceListener
    ,
    # don't forget to supply the cache.path property to specify the location of the cache
    # directory.
    #
    # If a persistence class is not specified
    , OSCache will use memory caching only.
    #
    # cache.persistence.class
    =com.opensymphony.oscache.plugins.diskpersistence.DiskPersistenceListener


    # CACHE DIRECTORY
    #
    # This is the directory on disk where caches will be stored by the DiskPersistenceListener.
    # it will be created if it doesn't already exist. Remember that OSCache must have
    # write permission to this directory.
    #
    # Note: for Windows machines
    , this needs \ to be escaped
    # ie Windows:
    # cache.path
    =c:\\myapp\\cache
    # or *ix:
    # cache.path
    =/opt/myapp/cache
    #
    # cache.path
    =c:\\app\\cache


    # CACHE ALGORITHM
    #
    # Default cache algorithm to use. Note that in order to use an algorithm
    # the cache size must also be specified. If the cache size is not specified
    ,
    # the cache algorithm will be Unlimited cache.
    #
    # cache.algorithm
    =com.opensymphony.oscache.base.algorithm.LRUCache
    # cache.algorithm
    =com.opensymphony.oscache.base.algorithm.FIFOCache
    # cache.algorithm
    =com.opensymphony.oscache.base.algorithm.UnlimitedCache


    # CACHE SIZE
    #
    # Default cache size in number of items. If a size is specified but not
    # an algorithm
    , the cache algorithm used will be LRUCache.
    #
    cache.capacity
    =1000


    # CACHE UNLIMITED DISK
    # Use unlimited disk cache or not. The default value is false
    , which means
    # the disk cache will be limited in size to the value specified by cache.capacity.
    #
    # cache.unlimited.disk
    =false


    # JMS CLUSTER PROPERTIES
    #
    # Configuration properties for JMS clustering. See the clustering documentation
    # for more information on these settings.
    #
    #cache.cluster.jms.topic.factory
    =java:comp/env/jms/TopicConnectionFactory
    #cache.cluster.jms.topic.name
    =java:comp/env/jms/OSCacheTopic
    #cache.cluster.jms.node.name
    =node1


    # JAVAGROUPS CLUSTER PROPERTIES
    #
    # Configuration properites for the JavaGroups clustering. Only one of these
    # should be specified. Default values (as shown below) will be used if niether
    # property is set. See the clustering documentation and the JavaGroups project
    # (www.javagroups.com) for more information on these settings.
    #
    #cache.cluster.properties
    =UDP(mcast_addr=231.12.21.132;mcast_port=45566;ip_ttl=32;mcast_send_buf_size=150000;mcast_recv_buf_size=80000):PING(timeout=2000;num_initial_members=3):MERGE2(min_interval=5000;max_interval=10000):FD_SOCK:VERIFY_SUSPECT(timeout=1500):pbcast.NAKACK(gc_lag=50;retransmit_timeout=300,600,1200,2400,4800):pbcast.STABLE(desired_avg_gossip=20000):UNICAST(timeout=5000):FRAG(frag_size=8096;down_thread=false;up_thread=false):pbcast.GMS(join_timeout=5000;join_retry_timeout=2000;shun=false;print_local_addr=true)
    #cache.cluster.multicast.ip=231.12.21.132

    然后就可以使用oscache進行JSP緩存了~~~
    posted on 2007-07-11 12:54 冰封的愛 閱讀(413) 評論(0)  編輯  收藏 所屬分類: J2EE
    <2025年5月>
    27282930123
    45678910
    11121314151617
    18192021222324
    25262728293031
    1234567

    常用鏈接

    留言簿(3)

    隨筆檔案

    文章分類

    文章檔案

    相冊

    搜索

    •  

    最新評論

    閱讀排行榜

    評論排行榜

    主站蜘蛛池模板: 2019中文字幕在线电影免费| 18成禁人视频免费网站| 免费无码肉片在线观看| 亚洲视频免费播放| 麻豆视频免费观看| 亚洲国产模特在线播放| 成人免费福利视频| 亚洲第一成人在线| 大陆一级毛片免费视频观看 | 久久青草免费91线频观看不卡| 国产精品亚洲综合天堂夜夜| 最近的中文字幕大全免费8| 亚洲自偷自偷偷色无码中文| 日韩av无码免费播放| 亚洲色欲色欲www在线丝| 国产亚洲精品免费视频播放| www.91亚洲| a毛片久久免费观看| 亚洲av无码不卡| 中文字幕天天躁日日躁狠狠躁免费| 在线视频免费观看爽爽爽| 亚洲gv猛男gv无码男同短文| 嫩草在线视频www免费观看| 亚洲妇熟XXXX妇色黄| 久久青草91免费观看| 亚洲影视自拍揄拍愉拍| 美女黄网站人色视频免费国产| 亚洲线精品一区二区三区影音先锋 | 免费看大黄高清网站视频在线| 亚洲日韩精品一区二区三区| 中文字幕免费观看全部电影| 综合自拍亚洲综合图不卡区| 日本阿v免费费视频完整版| 美女羞羞喷液视频免费| 亚洲av无码不卡| 四虎永久精品免费观看| 久久免费观看国产99精品| 亚洲欧美第一成人网站7777| 亚洲人精品午夜射精日韩| 免费看国产成年无码AV片| 国产精品福利在线观看免费不卡|