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

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

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

    posts - 431,  comments - 344,  trackbacks - 0

    There are no code changes required for this - your application server should support servlet filtering already. Simply update your web.xml file, re-deploy and you should see the speedup right away.

    The basic steps you'll need to follow to configure Ehcache for web page caching are (note that these steps assume you already have Ehcache installed in your application):

    1. Configure a servlet page filter in web.xml
    2. Configure an appropriate cache in ehcache.xml
    3. Start (or re-start) your application

    The following settings should help you setup web caching for your application.

    Step 1 - Add a filter to your web.xml

    The first thing you'll need to do is add a filter to enable page caching.

    The following web.xml settings will enable a servlet filter for page caching:

    <web-app xmlns="http://java.sun.com/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
    http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd "
    version="2.5">
    <filter>
    <filter-name>SimplePageCachingFilter</filter-name>
    <filter-class>net.sf.ehcache.constructs.web.filter.SimplePageCachingFilter
    </filter-class>
    </filter>
    <!-- This is a filter chain. They are executed in the order below.
    Do not change the order. -->
    <filter-mapping>
    <filter-name>SimplePageCachingFilter</filter-name>
    <url-pattern>/*</url-pattern>
    </filter-mapping>
    </web-app>

    Step 2 - Configure an ehcache.xml

    The second step to enabling web page caching is to configure ehcache with an appropriate ehcache.xml.

    The following ehcache.xml file should configure a reasonable default ehcache:

    <ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="../../main/config/ehcache.xsd">
    <cache name="SimplePageCachingFilter"
    maxElementsInMemory="10000"
    maxElementsOnDisk="1000"
    eternal="false"
    overflowToDisk="true"
    timeToIdleSeconds="300"
    timeToLiveSeconds="600"
    memoryStoreEvictionPolicy="LFU"
    />
    </ehcache>

    Step 3 - Start your application server

    Now start your application server. Pages should be cached.

    posted on 2011-05-12 16:11 周銳 閱讀(830) 評論(0)  編輯  收藏 所屬分類: HTMLJava
    主站蜘蛛池模板: 男女男精品网站免费观看| 亚洲国产成人资源在线软件| 亚洲精品国产V片在线观看| 国产精品四虎在线观看免费| 在线观看91精品国产不卡免费| 成人午夜视频免费| 午夜神器成在线人成在线人免费 | 亚洲综合色婷婷在线观看| 亚洲成a人片在线不卡| 亚洲天堂2016| 亚洲国产无线乱码在线观看| 亚洲AV无码成人精品区狼人影院| 亚洲国产精品无码中文lv| 日韩色日韩视频亚洲网站| 一本久久免费视频| 中文成人久久久久影院免费观看 | 亚洲av日韩aⅴ无码色老头| 美女啪啪网站又黄又免费| 一级全免费视频播放| 日韩a级无码免费视频| 91热成人精品国产免费| 成年人免费观看视频网站| 国产在线观看免费视频播放器| 亚洲精品A在线观看| 国产亚洲精品国产| 亚洲综合久久成人69| 自拍日韩亚洲一区在线| 久久亚洲色WWW成人欧美| 一边摸一边爽一边叫床免费视频 | 亚洲乱码一区二区三区国产精品| 亚洲七久久之综合七久久| 黄色毛片免费在线观看| 精品国产免费一区二区三区| 先锋影音资源片午夜在线观看视频免费播放| 免费A级毛片在线播放| 毛片a级毛片免费观看品善网| 亚洲AV成人潮喷综合网| 亚洲福利视频导航| 亚洲精品无码成人| 精品国产免费一区二区三区| 在线永久免费的视频草莓|