<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 周銳 閱讀(844) 評論(0)  編輯  收藏 所屬分類: HTMLJava
    主站蜘蛛池模板: 亚洲av无码片在线播放| 亚洲AV无码乱码在线观看性色扶 | 亚洲女人影院想要爱| 免费一区二区三区| 久久精品国产96精品亚洲| 中文字幕在线观看免费| 亚洲老妈激情一区二区三区| 久久成人永久免费播放| 久久亚洲高清综合| 国产一级在线免费观看| 亚洲精品国产精品乱码视色| baoyu777永久免费视频| 久久亚洲一区二区| 精品免费人成视频app| 亚洲免费视频观看| 成人免费在线视频| 青娱乐在线免费观看视频| 亚洲人成色77777在线观看大| 亚洲高清免费视频| 亚洲小视频在线观看| 一级日本高清视频免费观看| 免费人成视网站在线观看不卡| 草久免费在线观看网站| 亚洲伊人久久精品影院| 一级毛片免费视频| 一区二区亚洲精品精华液| 免费看一级做a爰片久久| aa级女人大片喷水视频免费| 日产亚洲一区二区三区| 好大好深好猛好爽视频免费| 国产午夜亚洲精品不卡电影| 亚洲色大成网站www永久一区| 最近2019免费中文字幕6| 亚洲精品天堂成人片AV在线播放 | 一级特黄aaa大片免费看| 亚洲成a人片在线观看无码 | 中文字幕亚洲不卡在线亚瑟| 日韩免费无码一区二区三区| jlzzjlzz亚洲jzjzjz| 亚洲人AV永久一区二区三区久久| 精品国产污污免费网站|