<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 周銳 閱讀(843) 評論(0)  編輯  收藏 所屬分類: HTMLJava
    主站蜘蛛池模板: 亚洲天堂免费在线视频| 久久九九全国免费| 亚洲日韩区在线电影| 一级免费黄色毛片| 日韩午夜理论免费TV影院| 亚洲国产精华液网站w| 最近免费mv在线观看动漫| 亚洲AV无码专区国产乱码电影| 国产午夜精品免费一区二区三区| 亚洲精品亚洲人成在线观看| 国产精品免费福利久久| 日韩视频在线免费| 亚洲a∨无码精品色午夜| 免费大学生国产在线观看p| 亚洲美女人黄网成人女| 国产精品亚洲五月天高清| 亚洲精品国产高清不卡在线| 亚洲精品综合久久中文字幕 | 亚洲人xxx日本人18| 又硬又粗又长又爽免费看 | 最近中文字幕免费mv视频7| 国产亚洲精品国看不卡| 亚洲日本久久久午夜精品 | 国产乱子精品免费视观看片| 亚洲五月综合网色九月色| 免费看无码自慰一区二区| 亚洲狠狠狠一区二区三区| 两个人的视频高清在线观看免费| 久久久久亚洲AV无码专区首| 日本免费一区二区在线观看| 亚洲欧美日韩中文二区| 久久久久国产免费| 91在线亚洲综合在线| 亚洲一区精品伊人久久伊人| 免费女人高潮流视频在线观看| 亚洲色欲色欲www| 国产亚洲精品无码拍拍拍色欲| **毛片免费观看久久精品| 久久亚洲AV成人无码国产| 国内自产少妇自拍区免费| 两性色午夜免费视频|