{"id":2120,"date":"2017-10-11T10:48:52","date_gmt":"2017-10-11T02:48:52","guid":{"rendered":"http:\/\/www.xttblog.com\/?p=2120"},"modified":"2017-10-11T10:48:52","modified_gmt":"2017-10-11T02:48:52","slug":"spring-cache%e7%9a%84%e5%8e%9f%e7%90%86%ef%bc%8c%e6%9c%ba%e5%88%b6%e5%92%8c%e4%bd%bf%e7%94%a8%e6%95%99%e7%a8%8b","status":"publish","type":"post","link":"https:\/\/www.xttblog.com\/?p=2120","title":{"rendered":"Spring Cache\u7684\u539f\u7406\uff0c\u673a\u5236\u548c\u4f7f\u7528\u6559\u7a0b"},"content":{"rendered":"<p>\n\t\u7f13\u5b58\u662f\u5b9e\u9645\u5de5\u4f5c\u4e2d\u975e\u5e38\u5e38\u7528\u7684\u4e00\u79cd\u63d0\u9ad8\u6027\u80fd\u7684\u65b9\u6cd5\u3002\u800c\u5728java\u4e2d\uff0c\u6240\u8c13\u7f13\u5b58\uff0c\u5c31\u662f\u5c06\u7a0b\u5e8f\u6216\u7cfb\u7edf\u7ecf\u5e38\u8981\u8c03\u7528\u7684\u5bf9\u8c61\u5b58\u5728\u5185\u5b58\u4e2d\uff0c\u518d\u6b21\u8c03\u7528\u65f6\u53ef\u4ee5\u5feb\u901f\u4ece\u5185\u5b58\u4e2d\u83b7\u53d6\u5bf9\u8c61\uff0c\u4e0d\u5fc5\u518d\u53bb\u521b\u5efa\u65b0\u7684\u91cd\u590d\u7684\u5b9e\u4f8b\u3002\u8fd9\u6837\u505a\u53ef\u4ee5\u51cf\u5c11\u7cfb\u7edf\u5f00\u9500\uff0c\u63d0\u9ad8\u7cfb\u7edf\u6548\u7387\u3002\n<\/p>\n<p>\n\t\u5728\u589e\u5220\u6539\u67e5\u4e2d\uff0c\u6570\u636e\u5e93\u67e5\u8be2\u5360\u636e\u4e86\u6570\u636e\u5e93\u64cd\u4f5c\u768480%\u4ee5\u4e0a\uff0c\u800c\u975e\u5e38\u9891\u7e41\u7684\u78c1\u76d8I\/O\u8bfb\u53d6\u64cd\u4f5c\uff0c\u4f1a\u5bfc\u81f4\u6570\u636e\u5e93\u6027\u80fd\u6781\u5ea6\u4f4e\u4e0b\u3002\u800c\u6570\u636e\u5e93\u7684\u91cd\u8981\u6027\u5c31\u4e0d\u8a00\u800c\u55bb\u4e86\uff1a\n<\/p>\n<ul>\n<li>\n\t\t\u6570\u636e\u5e93\u901a\u5e38\u662f\u4f01\u4e1a\u5e94\u7528\u7cfb\u7edf\u6700\u6838\u5fc3\u7684\u90e8\u5206\n\t<\/li>\n<li>\n\t\t\u6570\u636e\u5e93\u4fdd\u5b58\u7684\u6570\u636e\u91cf\u901a\u5e38\u975e\u5e38\u5e9e\u5927\n\t<\/li>\n<li>\n\t\t\u6570\u636e\u5e93\u67e5\u8be2\u64cd\u4f5c\u901a\u5e38\u5f88\u9891\u7e41\uff0c\u6709\u65f6\u8fd8\u5f88\u590d\u6742\n\t<\/li>\n<\/ul>\n<p>\n\t\u5728\u7cfb\u7edf\u67b6\u6784\u7684\u4e0d\u540c\u5c42\u7ea7\u4e4b\u95f4\uff0c\u4e3a\u4e86\u52a0\u5feb\u8bbf\u95ee\u901f\u5ea6\uff0c\u90fd\u53ef\u4ee5\u5b58\u5728\u7f13\u5b58\u3002\n<\/p>\n<p>\n\t<img decoding=\"async\" alt=\"spring cache\u7f13\u5b58\u7684\u4f5c\u7528\" src=\"http:\/\/ocuzluml6.bkt.clouddn.com\/20171011100144.png\" style=\"width: 611px;height: 359px\" \/>\n<\/p>\n<h2>\n\tSpring Cache\u7279\u6027\u4e0e\u7f3a\u61be<br \/>\n<\/h2>\n<p>\n\t\u73b0\u5728\u5e02\u573a\u4e0a\u4e3b\u6d41\u7684\u7f13\u5b58\u6846\u67b6\u6709ehcache\u3001redis\u3001memcached\u3002spring cache\u53ef\u4ee5\u901a\u8fc7\u7b80\u5355\u7684\u914d\u7f6e\u5c31\u53ef\u4ee5\u642d\u914d\u4f7f\u7528\u8d77\u6765\u3002\u5176\u4e2d\u4f7f\u7528\u6ce8\u89e3\u65b9\u5f0f\u662f\u6700\u7b80\u5355\u7684\u3002\n<\/p>\n<p>\n\t<img decoding=\"async\" alt=\"spring cache\u7279\u6027\u4e0e\u7f3a\u61be\" src=\"http:\/\/ocuzluml6.bkt.clouddn.com\/20171011101957.png\" style=\"width: 836px;height: 439px\" \/>\n<\/p>\n<h2>\n\tCache\u6ce8\u89e3<br \/>\n<\/h2>\n<p>\n\t<img decoding=\"async\" alt=\"Cache\u6ce8\u89e3\" src=\"http:\/\/img.bbs.csdn.net\/upload\/201710\/11\/1507688942_813395.png\" style=\"width: 963px;height: 827px\" \/>\n<\/p>\n<p>\n\t\u4ece\u4ee5\u4e0a\u7684\u6ce8\u89e3\u4e2d\u53ef\u4ee5\u770b\u51fa\uff0c\u867d\u7136\u4f7f\u7528\u6ce8\u89e3\u7684\u786e\u65b9\u4fbf\uff0c\u4f46\u662f\u7f3a\u5c11\u7075\u6d3b\u7684\u7f13\u5b58\u7b56\u7565\uff0c\u7f13\u5b58\u7b56\u7565\uff1a\n<\/p>\n<ul>\n<li>\n\t\tTTL\uff08Time To Live \uff09 \u5b58\u6d3b\u671f\uff0c\u5373\u4ece\u7f13\u5b58\u4e2d\u521b\u5efa\u65f6\u95f4\u70b9\u5f00\u59cb\u76f4\u5230\u5b83\u5230\u671f\u7684\u4e00\u4e2a\u65f6\u95f4\u6bb5\uff08\u4e0d\u7ba1\u5728\u8fd9\u4e2a\u65f6\u95f4\u6bb5\u5185\u6709\u6ca1\u6709\u8bbf\u95ee\u90fd\u5c06\u8fc7\u671f\uff09\n\t<\/li>\n<li>\n\t\tTTI\uff08Time To Idle\uff09 \u7a7a\u95f2\u671f\uff0c\u5373\u4e00\u4e2a\u6570\u636e\u591a\u4e45\u6ca1\u88ab\u8bbf\u95ee\u5c06\u4ece\u7f13\u5b58\u4e2d\u79fb\u9664\u7684\u65f6\u95f4\n\t<\/li>\n<\/ul>\n<p>\n\t\u9879\u76ee\u4e2d\u53ef\u80fd\u6709\u5f88\u591a\u7f13\u5b58\u7684TTL\u4e0d\u76f8\u540c\uff0c\u8fd9\u65f6\u5019\u5c31\u9700\u8981\u7f16\u7801\u5f0f\u4f7f\u7528\u7f16\u5199\u7f13\u5b58\u3002\n<\/p>\n<h2>\n\t\u6761\u4ef6\u7f13\u5b58<br \/>\n<\/h2>\n<p>\n\t\u6839\u636e\u8fd0\u884c\u6d41\u7a0b\uff0c\u5982\u4e0b@Cacheable\u5c06\u5728\u6267\u884c\u65b9\u6cd5\u4e4b\u524d( #result\u8fd8\u62ff\u4e0d\u5230\u8fd4\u56de\u503c)\u5224\u65adcondition\uff0c\u5982\u679c\u8fd4\u56detrue\uff0c\u5219\u67e5\u7f13\u5b58\uff1b&nbsp;\n<\/p>\n<pre class=\"brush:java;\">\r\n@Cacheable(value = &quot;user&quot;, key = &quot;#id&quot;, condition = &quot;#id lt 10&quot;)  \r\npublic User conditionFindById(final Long id)  <\/pre>\n<p>\n\t\u5982\u4e0b@CachePut\u5c06\u5728\u6267\u884c\u5b8c\u65b9\u6cd5\u540e\uff08#result\u5c31\u80fd\u62ff\u5230\u8fd4\u56de\u503c\u4e86\uff09\u5224\u65adcondition\uff0c\u5982\u679c\u8fd4\u56detrue\uff0c\u5219\u653e\u5165\u7f13\u5b58\n<\/p>\n<pre class=\"brush:java;\">\r\n@CachePut(value = &quot;user&quot;, key = &quot;#id&quot;, condition = &quot;#result.username ne &#039;zhang&#039;&quot;)  \r\npublic User conditionSave(final User user) <\/pre>\n<p>\n\t\u5982\u4e0b@CachePut\u5c06\u5728\u6267\u884c\u5b8c\u65b9\u6cd5\u540e\uff08#result\u5c31\u80fd\u62ff\u5230\u8fd4\u56de\u503c\u4e86\uff09\u5224\u65adunless\uff0c\u5982\u679c\u8fd4\u56defalse\uff0c\u5219\u653e\u5165\u7f13\u5b58\uff1b\uff08\u5373\u8ddfcondition\u76f8\u53cd\uff09\n<\/p>\n<pre class=\"brush:java;\">\r\n@CachePut(value = &quot;user&quot;, key = &quot;#user.id&quot;, unless = &quot;#result.username eq &#039;zhang&#039;&quot;)  \r\npublic User conditionSave2(final User user) <\/pre>\n<p>\n\t\u5982\u4e0b@CacheEvict\uff0c beforeInvocation=false\u8868\u793a\u5728\u65b9\u6cd5\u6267\u884c\u4e4b\u540e\u8c03\u7528\uff08#result\u80fd\u62ff\u5230\u8fd4\u56de\u503c\u4e86\uff09\uff1b\u4e14\u5224\u65adcondition\uff0c\u5982\u679c\u8fd4\u56detrue\uff0c\u5219\u79fb\u9664\u7f13\u5b58\uff1b\n<\/p>\n<pre class=\"brush:java;\">\r\n@CacheEvict(value = &quot;user&quot;, key = &quot;#user.id&quot;, beforeInvocation = false, condition = &quot;#result.username ne &#039;zhang&#039;&quot;) \r\npublic User conditionDelete(final User user) <\/pre>\n<p>\n\t\u4e0b\u9762\u770b\u4e00\u4e2a\u7efc\u5408\u5e94\u7528\u7684\u6848\u4f8b\uff1a\n<\/p>\n<pre class=\"brush:java;\">\r\n@CachePut(value = &quot;user&quot;, key = &quot;#user.id&quot;)\r\npublic User save(User user) {\r\n\tusers.add(user);\r\n\treturn user;\r\n}\r\n@CachePut(value = &quot;user&quot;, key = &quot;#user.id&quot;)\r\npublic User update(User user) {\r\n\tusers.remove(user);\r\n\tusers.add(user);\r\n\treturn user;\r\n}\r\n@CacheEvict(value = &quot;user&quot;, key = &quot;#user.id&quot;)\r\npublic User delete(User user) {\r\n\tusers.remove(user);\r\n\treturn user;\r\n}\r\n@CacheEvict(value = &quot;user&quot;, allEntries = true)\r\npublic void deleteAll() {\r\n\tusers.clear();\r\n}\r\n@Cacheable(value = &quot;user&quot;, key = &quot;#id&quot;)\r\npublic User findById(final Long id) {\r\n\tSystem.out.println(&quot;cache miss, invoke find by id, id:&quot; + id);\r\n\tfor (User user : users) {\r\n\t\tif (user.getId().equals(id)) {\r\n\t\t\treturn user;\r\n\t\t}\r\n\t}\/\/ \u4e1a\u4f59\u8349\uff1awww.xttblog.com\r\n\treturn null;\r\n}<\/pre>\n<h2>\n\t\u914d\u7f6eehcache\u4e0eredis<br \/>\n<\/h2>\n<p>\n\tspring cache\u96c6\u6210ehcache\uff0cspring-ehcache.xml\u4e3b\u8981\u5185\u5bb9\uff1a\n<\/p>\n<pre class=\"brush:xml;\">\r\n&lt;dependency&gt;\r\n\t&lt;groupId&gt;net.sf.ehcache&lt;\/groupId&gt;\r\n\t&lt;artifactId&gt;ehcache-core&lt;\/artifactId&gt;\r\n\t&lt;version&gt;${ehcache.version}&lt;\/version&gt;\r\n&lt;\/dependency&gt;<\/pre>\n<pre class=\"brush:xml;\">\r\n&lt;!-- Spring\u63d0\u4f9b\u7684\u57fa\u4e8e\u7684Ehcache\u5b9e\u73b0\u7684\u7f13\u5b58\u7ba1\u7406\u5668 --&gt;\r\n&lt;!-- \u5982\u679c\u6709\u591a\u4e2aehcacheManager\u8981\u5728bean\u52a0\u4e0ap:shared=&quot;true&quot; --&gt;\r\n&lt;bean id=&quot;ehcacheManager&quot; class=&quot;org.springframework.cache.ehcache.EhCacheManagerFactoryBean&quot;&gt;\r\n     &lt;property name=&quot;configLocation&quot; value=&quot;classpath:xml\/ehcache.xml&quot;\/&gt;\r\n&lt;\/bean&gt;\r\n&lt;bean id=&quot;cacheManager&quot; class=&quot;org.springframework.cache.ehcache.EhCacheCacheManager&quot;&gt;\r\n     &lt;property name=&quot;cacheManager&quot; ref=&quot;ehcacheManager&quot;\/&gt;\r\n     &lt;property name=&quot;transactionAware&quot; value=&quot;true&quot;\/&gt;\r\n&lt;\/bean&gt;\r\n&lt;!-- cache\u6ce8\u89e3\uff0c\u548cspring-redis.xml\u4e2d\u7684\u53ea\u80fd\u4f7f\u7528\u4e00\u4e2a --&gt;\r\n&lt;cache:annotation-driven cache-manager=&quot;cacheManager&quot; proxy-target-class=&quot;true&quot;\/&gt;<\/pre>\n<p>\n\tspring cache\u96c6\u6210redis\uff0cspring-redis.xml\u4e3b\u8981\u5185\u5bb9\uff1a\n<\/p>\n<pre class=\"brush:xml;\">\r\n&lt;dependency&gt;\r\n\t&lt;groupId&gt;org.springframework.data&lt;\/groupId&gt;\r\n\t&lt;artifactId&gt;spring-data-redis&lt;\/artifactId&gt;\r\n\t&lt;version&gt;1.8.1.RELEASE&lt;\/version&gt;\r\n&lt;\/dependency&gt;\r\n&lt;dependency&gt;\r\n\t&lt;groupId&gt;org.apache.commons&lt;\/groupId&gt;\r\n\t&lt;artifactId&gt;commons-pool2&lt;\/artifactId&gt;\r\n\t&lt;version&gt;2.4.2&lt;\/version&gt;\r\n&lt;\/dependency&gt;\r\n&lt;dependency&gt;\r\n\t&lt;groupId&gt;redis.clients&lt;\/groupId&gt;\r\n\t&lt;artifactId&gt;jedis&lt;\/artifactId&gt;\r\n\t&lt;version&gt;2.9.0&lt;\/version&gt;\r\n&lt;\/dependency&gt;<\/pre>\n<pre class=\"brush:xml;\">\r\n&lt;!-- \u6ce8\u610f\u9700\u8981\u6dfb\u52a0Spring Data Redis\u7b49jar\u5305 --&gt;\r\n&lt;description&gt;redis\u914d\u7f6e&lt;\/description&gt;\r\n&lt;bean id=&quot;jedisPoolConfig&quot; class=&quot;redis.clients.jedis.JedisPoolConfig&quot;&gt;\r\n\t&lt;property name=&quot;maxIdle&quot; value=&quot;${redis.pool.maxIdle}&quot;\/&gt;\r\n\t&lt;property name=&quot;maxTotal&quot; value=&quot;${redis.pool.maxActive}&quot;\/&gt;\r\n\t&lt;property name=&quot;maxWaitMillis&quot; value=&quot;${redis.pool.maxWait}&quot;\/&gt;\r\n\t&lt;property name=&quot;testOnBorrow&quot; value=&quot;${redis.pool.testOnBorrow}&quot;\/&gt;\r\n\t&lt;property name=&quot;testOnReturn&quot; value=&quot;${redis.pool.testOnReturn}&quot;\/&gt;\r\n&lt;\/bean&gt;\r\n&lt;!-- JedisConnectionFactory --&gt;\r\n&lt;bean id=&quot;jedisConnectionFactory&quot; class=&quot;org.springframework.data.redis.connection.jedis.JedisConnectionFactory&quot;&gt;\r\n\t&lt;property name=&quot;hostName&quot; value=&quot;${redis.master.ip}&quot;\/&gt;\r\n\t&lt;property name=&quot;port&quot; value=&quot;${redis.master.port}&quot;\/&gt;\r\n\t&lt;property name=&quot;poolConfig&quot; ref=&quot;jedisPoolConfig&quot;\/&gt;\r\n&lt;\/bean&gt;\r\n&lt;bean id=&quot;redisTemplate&quot; class=&quot;org.springframework.data.redis.core.RedisTemplate&quot;\r\n\t  p:connectionFactory-ref=&quot;jedisConnectionFactory&quot;&gt;\r\n\t&lt;property name=&quot;keySerializer&quot;&gt;\r\n\t\t&lt;bean class=&quot;org.springframework.data.redis.serializer.JdkSerializationRedisSerializer&quot;&gt;&lt;\/bean&gt;\r\n\t&lt;\/property&gt;\r\n\t&lt;property name=&quot;valueSerializer&quot;&gt;\r\n\t\t&lt;bean class=&quot;org.springframework.data.redis.serializer.JdkSerializationRedisSerializer&quot;\/&gt;\r\n\t&lt;\/property&gt;\r\n\t&lt;property name=&quot;hashKeySerializer&quot;&gt;\r\n\t\t&lt;bean class=&quot;org.springframework.data.redis.serializer.JdkSerializationRedisSerializer&quot;\/&gt;\r\n\t&lt;\/property&gt;\r\n\t&lt;property name=&quot;hashValueSerializer&quot;&gt;\r\n\t\t&lt;bean class=&quot;org.springframework.data.redis.serializer.JdkSerializationRedisSerializer&quot;\/&gt;\r\n\t&lt;\/property&gt;\r\n&lt;\/bean&gt;\r\n&lt;!--spring cache--&gt;\r\n&lt;bean id=&quot;cacheManager&quot; class=&quot;org.springframework.data.redis.cache.RedisCacheManager&quot;\r\n\t  c:redisOperations-ref=&quot;redisTemplate&quot;&gt;\r\n\t&lt;!-- \u9ed8\u8ba4\u7f13\u5b5810\u5206\u949f --&gt;\r\n\t&lt;property name=&quot;defaultExpiration&quot; value=&quot;600&quot;\/&gt;\r\n\t&lt;property name=&quot;usePrefix&quot; value=&quot;true&quot;\/&gt;\r\n\t&lt;!-- cacheName \u7f13\u5b58\u8d85\u65f6\u914d\u7f6e\uff0c\u534a\u5c0f\u65f6\uff0c\u4e00\u5c0f\u65f6\uff0c\u4e00\u5929 --&gt;\r\n\t&lt;property name=&quot;expires&quot;&gt;\r\n\t\t&lt;map key-type=&quot;java.lang.String&quot; value-type=&quot;java.lang.Long&quot;&gt;\r\n\t\t\t&lt;entry key=&quot;halfHour&quot; value=&quot;1800&quot;\/&gt;\r\n\t\t\t&lt;entry key=&quot;hour&quot; value=&quot;3600&quot;\/&gt;\r\n\t\t\t&lt;entry key=&quot;oneDay&quot; value=&quot;86400&quot;\/&gt;\r\n\t\t\t&lt;!-- shiro cache keys --&gt;\r\n\t\t\t&lt;entry key=&quot;authorizationCache&quot; value=&quot;1800&quot;\/&gt;\r\n\t\t\t&lt;entry key=&quot;authenticationCache&quot; value=&quot;1800&quot;\/&gt;\r\n\t\t\t&lt;entry key=&quot;activeSessionCache&quot; value=&quot;1800&quot;\/&gt;\r\n\t\t&lt;\/map&gt;\r\n\t&lt;\/property&gt;\r\n&lt;\/bean&gt;\r\n&lt;!-- cache\u6ce8\u89e3\uff0c\u548cspring-ehcache.xml\u4e2d\u7684\u53ea\u80fd\u4f7f\u7528\u4e00\u4e2a --&gt;\r\n&lt;cache:annotation-driven cache-manager=&quot;cacheManager&quot; proxy-target-class=&quot;true&quot;\/&gt;<\/pre>\n<p>\n\t\u9879\u76ee\u4e2d\u6ce8\u89e3\u7f13\u5b58\u53ea\u80fd\u914d\u7f6e\u4e00\u4e2a\uff0c\u6240\u4ee5\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u5f15\u5165\u54ea\u4e2a\u914d\u7f6e\u6587\u4ef6\u6765\u51b3\u5b9a\u4f7f\u7528\u54ea\u4e2a\u7f13\u5b58\u3002\n<\/p>\n<pre class=\"brush:xml;\">\r\n&lt;import resource=&quot;classpath:spring\/spring-ehcache.xml&quot;\/&gt;\r\n&lt;!-- &lt;import resource=&quot;classpath:spring\/spring-redis.xml&quot;\/&gt;--&gt;<\/pre>\n<p>\n\t\u5f53\u7136\uff0c\u53ef\u4ee5\u901a\u8fc7\u5176\u4ed6\u914d\u7f6e\u642d\u914d\u4f7f\u7528\u4e24\u4e2a\u7f13\u5b58\u673a\u5236\u3002\u6bd4\u5982ecache\u505a\u4e00\u7ea7\u7f13\u5b58\uff0credis\u505a\u4e8c\u7ea7\u7f13\u5b58\u3002\n<\/p>\n<p>\n\t<img decoding=\"async\" alt=\"Cache \u548c Redis \u7f13\u5b58\u5bf9\u6bd4\" src=\"http:\/\/img.bbs.csdn.net\/upload\/201710\/11\/1507689913_905532.png\" style=\"width: 836px;height: 299px\" \/>\n<\/p>\n<p>\n\t\u672c\u6587\u5b9e\u4f8b\u7684\u76f8\u5173\u6e90\u7801\uff0c\u53ef\u4ee5\u79fb\u6b65\u5230\uff0c<a href=\"https:\/\/git.oschina.net\/wangzhixuan\/spring-shiro-training.git\" name=\"spring cache \u6559\u7a0b\" target=\"_blank\" title=\"spring cache \u6559\u7a0b\">https:\/\/git.oschina.net\/wangzhixuan\/spring-shiro-training.git<\/a>\u8fdb\u884c\u4e0b\u8f7d\u3002<\/p>\n<!-- <audio autoplay=\"autoplay\" height=\"100\" width=\"100\" hidden=\"true\"><source src=\"https:\/\/c.coka.la\/orAvPR.mp3\" type=\"audio\/mp3\"\/><\/audio><img decoding=\"async\" src=\"https:\/\/images.weserv.nl\/?url=https:\/\/ws3.sinaimg.cn\/large\/8fa5dcfcgy1g4em3rzar5j20ib089ae0.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/> --><p><!-- <img decoding=\"async\" src=\"https:\/\/raw.githubusercontent.com\/xmt1139057136\/xttblog\/master\/8fa5dcfcgy1g4em3rzar5j20ib089ae0.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/>--><img decoding=\"async\" src=\"https:\/\/saas.51autoparts.cn\/api\/admin\/sys-file\/oss\/file?fileName=84db51f8561e448f9a4fda2eff0811f9.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/><\/p><p>\u6700\u540e\uff0c\u6b22\u8fce\u5173\u6ce8\u6211\u7684\u4e2a\u4eba\u5fae\u4fe1\u516c\u4f17\u53f7\uff1a\u4e1a\u4f59\u8349\uff08yyucao\uff09\uff01<b>\u53ef\u52a0\u4f5c\u8005\u5fae\u4fe1\u53f7\uff1a<font color=\"red\">xttblog2<\/font>\u3002\u5907\u6ce8\uff1a\u201c1\u201d\uff0c\u6dfb\u52a0\u535a\u4e3b\u5fae\u4fe1\u62c9\u4f60\u8fdb\u5fae\u4fe1\u7fa4\u3002\u5907\u6ce8\u9519\u8bef\u4e0d\u4f1a\u540c\u610f\u597d\u53cb\u7533\u8bf7\u3002<\/b>\u518d\u6b21\u611f\u8c22\u60a8\u7684\u5173\u6ce8\uff01\u540e\u7eed\u6709\u7cbe\u5f69\u5185\u5bb9\u4f1a\u7b2c\u4e00\u65f6\u95f4\u53d1\u7ed9\u60a8\uff01\u539f\u521b\u6587\u7ae0\u6295\u7a3f\u8bf7\u53d1\u9001\u81f3532009913@qq.com\u90ae\u7bb1\u3002\u5546\u52a1\u5408\u4f5c\u4e5f\u53ef\u6dfb\u52a0\u4f5c\u8005\u5fae\u4fe1\u8fdb\u884c\u8054\u7cfb\uff01<\/p><p>\u672c\u6587\u539f\u6587\u51fa\u5904\uff1a<a href=\"https:\/\/www.xttblog.com\">\u4e1a\u4f59\u8349<\/a>\uff1a &raquo; <a href=\"https:\/\/www.xttblog.com\/?p=2120\">Spring Cache\u7684\u539f\u7406\uff0c\u673a\u5236\u548c\u4f7f\u7528\u6559\u7a0b<\/a><\/p><!-- <div class=\"bd-reward-stl\"><button id=\"bdRewardBtn\"><span><\/span><\/button><\/div> -->","protected":false},"excerpt":{"rendered":"<p>\u7f13\u5b58\u662f\u5b9e\u9645\u5de5\u4f5c\u4e2d\u975e\u5e38\u5e38\u7528\u7684\u4e00\u79cd\u63d0\u9ad8\u6027\u80fd\u7684\u65b9\u6cd5\u3002\u800c\u5728java\u4e2d\uff0c\u6240\u8c13\u7f13\u5b58\uff0c\u5c31\u662f\u5c06\u7a0b\u5e8f\u6216\u7cfb\u7edf\u7ecf\u5e38\u8981\u8c03\u7528\u7684\u5bf9\u8c61\u5b58\u5728\u5185 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[1510,669,551,623,584],"class_list":["post-2120","post","type-post","status-publish","format-standard","hentry","category-java","tag-ehcache","tag-redis","tag-spring","tag-web","tag-584"],"_links":{"self":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/2120","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2120"}],"version-history":[{"count":1,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/2120\/revisions"}],"predecessor-version":[{"id":2121,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/2120\/revisions\/2121"}],"wp:attachment":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2120"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2120"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2120"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}