代码拉取完成,页面将自动刷新
二级缓存其实没啥文档,在mapper配置上
<cache eviction="LRU" flushInterval="60000" type="org.apache.ibatis.caches.memcached.XMemcachedCache" />,
然后再加个xmemcached配置文件,在项目的resources/xmemcached.xml里配置具体的地址信息, 具体配置信息如下:
<bean class="org.mybatis.caches.xmemcached.SpringContextHolder" />
<bean name="memcachedClientBuilder" class="org.mybatis.caches.xmemcached.MybatisXMemcachedClientBuilder">
<!-- XMemcachedClientBuilder have two arguments.First is server list,and
second is weights array. -->
<constructor-arg>
<list>
<bean class="java.net.InetSocketAddress">
<constructor-arg>
<value>localhost</value>
</constructor-arg>
<constructor-arg>
<value>11211</value>
</constructor-arg>
</bean>
<bean class="java.net.InetSocketAddress">
<constructor-arg>
<value>localhost</value>
</constructor-arg>
<constructor-arg>
<value>12001</value>
</constructor-arg>
</bean> -->
</list>
</constructor-arg>
<constructor-arg>
<list>
<value>1</value>
<value>2</value>
</list>
</constructor-arg> -->
<property name="connectionPoolSize" value="2"></property>
<property name="commandFactory">
<bean class="net.rubyeye.xmemcached.command.TextCommandFactory"></bean>
</property>
<property name="sessionLocator">
<bean class="net.rubyeye.xmemcached.impl.KetamaMemcachedSessionLocator"></bean>
</property>
<property name="transcoder">
<bean class="net.rubyeye.xmemcached.transcoders.SerializingTranscoder" />
</property>
<property name="keyPrefix" value="mybatis-xmemcached-"></property>
<!-- unit:seconds -->
<property name="expiration" value="300"></property>
</bean>
<!-- Use factory bean to build memcached client -->
<bean name="xmemcachedClient" factory-bean="memcachedClientBuilder"
factory-method="build" destroy-method="shutdown" />
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。