Shiro articles: cache configuration

Overview

Because multiple authorization operations are required for each run, in order to avoid resource waste, add cache configuration for shiro
Insert picture description here

1. Import xml

2. Configure the cache in applicationContext-shiro.xml

Insert picture description here
Insert picture description here

<!--===========ehcache配置开始============-->
    <bean id="cacheManager" class="org.apache.shiro.cache.ehcache.EhCacheManager">
        <property name="cacheManagerConfigFile" value="classpath:ehcache.xml"></property>
    </bean>
    <!--===========ehcache配置结束============-->

<!--缓存管理-->
        <property name="cacheManager" ref="cacheManager"></property>

Guess you like

Origin blog.csdn.net/qq_39773004/article/details/109092130