{"id":1643,"date":"2017-07-14T16:25:16","date_gmt":"2017-07-14T08:25:16","guid":{"rendered":"http:\/\/www.xttblog.com\/?p=1643"},"modified":"2017-07-14T16:25:47","modified_gmt":"2017-07-14T08:25:47","slug":"%e8%af%a6%e8%a7%a3-spring-mvc-%e4%b8%ad%e7%9a%84-cacheseconds-%e5%92%8c-last-modified","status":"publish","type":"post","link":"https:\/\/www.xttblog.com\/?p=1643","title":{"rendered":"\u8be6\u89e3 Spring MVC \u4e2d\u7684 cacheSeconds \u548c Last-Modified"},"content":{"rendered":"<p>\n\t\u5173\u4e8e Session \u540c\u6b65\u4e00\u822c\u5728 SSO \u5355\u70b9\u767b\u5f55\u4e2d\u4f1a\u7528\u5230\u3002\u5728 Struts2 \u4e2d\u6211\u4eec\u4e00\u822c\u91c7\u7528\u7684\u90fd\u662f Servlet \u9ed8\u8ba4\u7684\u914d\u7f6e\u3002\u4f46\u6709\u65f6\u5019\u6709\u4e9b\u9700\u8981\u548c\u573a\u666f\u5374\u9700\u8981\u6211\u4eec\u8fdb\u884c Session \u540c\u6b65\u914d\u7f6e\u3002\u4f8b\u5982\u5173\u4e8e\u7f13\u5b58\u65b9\u9762\u7684\u914d\u7f6e\uff0c\u5982\u679c\u6709\u5206\u5e03\u5f0f\u7cfb\u7edf\uff0c\u4e0d\u8fdb\u884c Session \u540c\u6b65\uff0c\u5c31\u4f1a\u4ea7\u751f\u5f88\u4e25\u91cd\u7684\u95ee\u9898\u3002\u672c\u7ae0\u5c06\u91cd\u70b9\u8bb2\u89e3 SpringMVC\u4e2d\u7684cacheSeconds\u77e5\u8bc6\u3002\n<\/p>\n<h2>\n\t\u5ba2\u6237\u7aefcacheSeconds\u7f13\u5b58\u63a7\u5236<br \/>\n<\/h2>\n<p>\n\t\u6211\u4eec\u5148\u8bbe\u7f6e\u7f13\u5b585\u79d2\uff0ccacheSeconds=5\uff0c\u770b\u770b\u6548\u679c\u3002\n<\/p>\n<pre class=\"brush:java;\">\r\npackage cn.javass.chapter4.web.controller;\r\n\/\/\u7701\u7565import\r\npublic class HelloWorldCacheController extends AbstractController {\r\n\t@Override\r\n\tprotected ModelAndView handleRequestInternal(HttpServletRequest req, \r\n\t\tHttpServletResponse resp) throws Exception {\r\n\t\t\/\/\u70b9\u51fb\u540e\u518d\u6b21\u8bf7\u6c42\u5f53\u524d\u9875\u9762\r\n\t\tresp.getWriter().write(&quot;&lt;a href=&#039;&#039;&gt;this&lt;\/a&gt;&quot;);\r\n\t\treturn null;\r\n\t}\r\n}<\/pre>\n<pre class=\"brush:xml;\">\r\n&lt;!&mdash; \u5728chapter4-servlet.xml\u914d\u7f6e\u5904\u7406\u5668 --&gt;\r\n&lt;bean name=&quot;\/helloCache&quot; class=&quot;com.xttblog.web.controller.HelloWorldCacheController&quot;&gt;\r\n\t&lt;property name=&quot;cacheSeconds&quot; value=&quot;5&quot;\/&gt;\r\n&lt;\/bean&gt;<\/pre>\n<p>\n\t\u5982\u4e0a\u914d\u7f6e\u8868\u793a\u544a\u8bc9\u6d4f\u89c8\u5668\u7f13\u5b585\u79d2\u949f,\u5f00\u542fchrome\u6d4f\u89c8\u5668\u8c03\u8bd5\u5de5\u5177\u3002\n<\/p>\n<p>\n\t<img decoding=\"async\" alt=\"\u5f00\u542fchrome\u6d4f\u89c8\u5668\u8c03\u8bd5\u5de5\u5177\" src=\"http:\/\/ocuzluml6.bkt.clouddn.com\/a1.JPG\" style=\"width: 860px;height: 552px\" \/>\n<\/p>\n<p>\n\t\u670d\u52a1\u5668\u8fd4\u56de\u7684\u54cd\u5e94\u5934\u5982\u4e0b\u6240\u793a\uff1a\n<\/p>\n<p>\n\t<img decoding=\"async\" alt=\"http \u8fd4\u56de\u7684\u4fe1\u606f\u5934\" src=\"http:\/\/ocuzluml6.bkt.clouddn.com\/b1.JPG\" style=\"width: 741px;height: 314px\" \/>\n<\/p>\n<p>\n\t\u6dfb\u52a0\u4e86&ldquo;Expires:Wed, 14 Mar 2012 09:38:32 GMT&rdquo; \u548c&ldquo;Cache-Control:max-age=5&rdquo; \u8868\u793a\u5141\u8bb8\u5ba2\u6237\u7aef\u7f13\u5b585\u79d2\uff0c\u5f53\u4f60\u70b9&ldquo;this&rdquo;\u94fe\u63a5\u65f6\uff0c\u4f1a\u53d1\u73b0\u5982\u4e0b\uff1a\n<\/p>\n<p>\n\t<img decoding=\"async\" alt=\"\u6d4f\u89c8\u5668 console \u7a97\u53e3\u67e5\u770b\u7f13\u5b58\u4fe1\u606f\" src=\"http:\/\/ocuzluml6.bkt.clouddn.com\/c1.JPG\" style=\"width: 859px;height: 126px\" \/>\n<\/p>\n<p>\n\t\u800c\u4e14\u670d\u52a1\u5668\u4e5f\u6ca1\u6709\u6536\u5230\u8bf7\u6c42\uff0c\u5f53\u8fc7\u4e865\u79d2\u540e\uff0c\u4f60\u518d\u70b9&ldquo;this&rdquo;\u94fe\u63a5\u4f1a\u53d1\u73b0\u53c8\u91cd\u65b0\u8bf7\u6c42\u670d\u52a1\u5668\u4e0b\u8f7d\u65b0\u6570\u636e\u3002\n<\/p>\n<p>\n\t\u6ce8\uff1a\u4e0b\u9762\u63d0\u5230\u4e00\u4e9b\u5173\u4e8e\u7f13\u5b58\u63a7\u5236\u7684\u4e00\u4e9b\u7279\u6b8a\u60c5\u51b5\uff1a\n<\/p>\n<ol>\n<li>\n\t\t\u5bf9\u4e8e\u4e00\u822c\u7684\u9875\u9762\u8df3\u8f6c\uff08\u5982\u8d85\u94fe\u63a5\u70b9\u51fb\u8df3\u8f6c\u3001\u901a\u8fc7js\u8c03\u7528window.open\u6253\u5f00\u65b0\u9875\u9762\u90fd\u662f\u4f1a\u4f7f\u7528\u6d4f\u89c8\u5668\u7f13\u5b58\u7684\uff0c\u5728\u672a\u8fc7\u671f\u60c5\u51b5\u4e0b\u4f1a\u76f4\u63a5\u4f7f\u7528\u6d4f\u89c8\u5668\u7f13\u5b58\u7684\u526f\u672c\uff0c\u5728\u672a\u8fc7\u671f\u60c5\u51b5\u4e0b\u4e00\u6b21\u8bf7\u6c42\u4e5f\u4e0d\u53d1\u9001\uff09\uff1b\n\t<\/li>\n<li>\n\t\t\u5bf9\u4e8e\u5237\u65b0\u9875\u9762\uff08\u5982\u6309F5\u952e\u5237\u65b0\uff09\uff0c\u4f1a\u518d\u6b21\u53d1\u9001\u4e00\u6b21\u8bf7\u6c42\u5230\u670d\u52a1\u5668\u7684\uff1b\n\t<\/li>\n<\/ol>\n<h2>\n\t\u4e0d\u7f13\u5b58\uff0ccacheSeconds=0<br \/>\n<\/h2>\n<pre class=\"brush:xml;\">\r\n&lt;!&mdash; \u5728chapter4-servlet.xml\u914d\u7f6e\u5904\u7406\u5668 --&gt;\r\n&lt;bean name=&quot;\/helloNoCache&quot;\r\n\tclass=&quot;com.xttblog.web.controller.HelloWorldCacheController&quot;&gt;\r\n\t&lt;property name=&quot;cacheSeconds&quot; value=&quot;0&quot;\/&gt;\r\n&lt;\/bean&gt;<\/pre>\n<p>\n\t\u4ee5\u4e0a\u914d\u7f6e\u4f1a\u8981\u6c42\u6d4f\u89c8\u5668\u6bcf\u6b21\u90fd\u53bb\u8bf7\u6c42\u670d\u52a1\u5668\u4e0b\u8f7d\u6700\u65b0\u7684\u6570\u636e\uff1a\n<\/p>\n<p>\n\t<img decoding=\"async\" alt=\"\u6d4f\u89c8\u5668 \u8c03\u8bd5\u5de5\u5177 network \u4e2d\u67e5\u770b\u7f13\u5b58\u4fe1\u606f\" src=\"http:\/\/ocuzluml6.bkt.clouddn.com\/d1.JPG\" style=\"width: 859px;height: 357px\" \/>\n<\/p>\n<h2>\n\tcacheSeconds&lt;0\uff0c\u5c06\u4e0d\u6dfb\u52a0\u4efb\u4f55\u6570\u636e<br \/>\n<\/h2>\n<p>\n\t\u54cd\u5e94\u5934\u4ec0\u4e48\u7f13\u5b58\u63a7\u5236\u4fe1\u606f\u4e5f\u4e0d\u52a0\u3002\n<\/p>\n<h2>\n\tLast-Modified\u7f13\u5b58\u673a\u5236<br \/>\n<\/h2>\n<ul>\n<li>\n\t\t\u5728\u5ba2\u6237\u7aef\u7b2c\u4e00\u6b21\u8f93\u5165url\u65f6\uff0c\u670d\u52a1\u5668\u7aef\u4f1a\u8fd4\u56de\u5185\u5bb9\u548c\u72b6\u6001\u7801200\u8868\u793a\u8bf7\u6c42\u6210\u529f\u5e76\u8fd4\u56de\u4e86\u5185\u5bb9\uff1b\u540c\u65f6\u4f1a\u6dfb\u52a0\u4e00\u4e2a&ldquo;Last-Modified&rdquo;\u7684\u54cd\u5e94\u5934\u8868\u793a\u6b64\u6587\u4ef6\u5728\u670d\u52a1\u5668\u4e0a\u7684\u6700\u540e\u66f4\u65b0\u65f6\u95f4\uff0c\u5982&ldquo;Last-Modified:Wed, 14 Mar 2012 10:22:42 GMT&rdquo;\u8868\u793a\u6700\u540e\u66f4\u65b0\u65f6\u95f4\u4e3a\uff082012-03-14 10\uff1a22\uff09\uff1b\n\t<\/li>\n<li>\n\t\t\u5ba2\u6237\u7aef\u7b2c\u4e8c\u6b21\u8bf7\u6c42\u6b64URL\u65f6\uff0c\u5ba2\u6237\u7aef\u4f1a\u5411\u670d\u52a1\u5668\u53d1\u9001\u8bf7\u6c42\u5934 &ldquo;If-Modified-Since&rdquo;\uff0c\u8be2\u95ee\u670d\u52a1\u5668\u8be5\u65f6\u95f4\u4e4b\u540e\u5f53\u524d\u8bf7\u6c42\u5185\u5bb9\u662f\u5426\u6709\u88ab\u4fee\u6539\u8fc7\uff0c\u5982&ldquo;If-Modified-Since: Wed, 14 Mar 2012 10:22:42 GMT&rdquo;\uff0c\u5982\u679c\u670d\u52a1\u5668\u7aef\u7684\u5185\u5bb9\u6ca1\u6709\u53d8\u5316\uff0c\u5219\u81ea\u52a8\u8fd4\u56de HTTP 304\u72b6\u6001\u7801\uff08\u53ea\u8981\u54cd\u5e94\u5934\uff0c\u5185\u5bb9\u4e3a\u7a7a\uff0c\u8fd9\u6837\u5c31\u8282\u7701\u4e86\u7f51\u7edc\u5e26\u5bbd\uff09\u3002\n\t<\/li>\n<\/ul>\n<h2>\n\t\u5ba2\u6237\u7aef\u5f3a\u5236\u7f13\u5b58\u8fc7\u671f<br \/>\n<\/h2>\n<ul>\n<li>\n\t\t\u53ef\u4ee5\u6309ctrl+F5\u5f3a\u5236\u5237\u65b0\uff08\u4f1a\u6dfb\u52a0\u8bf7\u6c42\u5934 HTTP1.0 Pragma:no-cache\u548c HTTP1.1 Cache-Control:no-cache\u3001If-Modified-Since\u8bf7\u6c42\u5934\u88ab\u5220\u9664\uff09\u8868\u793a\u5f3a\u5236\u83b7\u53d6\u670d\u52a1\u5668\u5185\u5bb9\uff0c\u4e0d\u7f13\u5b58\u3002\n\t<\/li>\n<li>\n\t\t\u5728\u8bf7\u6c42\u7684url\u540e\u8fb9\u52a0\u4e0a\u65f6\u95f4\u6233\u6765\u91cd\u65b0\u83b7\u53d6\u5185\u5bb9\uff0c\u52a0\u4e0a\u65f6\u95f4\u6233\u540e\u6d4f\u89c8\u5668\u5c31\u8ba4\u4e3a\u4e0d\u662f\u540c\u4e00\u4efd\u5185\u5bb9.\n\t<\/li>\n<\/ul>\n<p>\n\tSpring\u4e5f\u63d0\u4f9b\u4e86Last-Modified\u673a\u5236\u7684\u652f\u6301\uff0c\u53ea\u9700\u8981\u5b9e\u73b0LastModified\u63a5\u53e3\uff0c\u5982\u4e0b\u6240\u793a\uff1a\n<\/p>\n<pre class=\"brush:java;\">\r\npackage com.xttblog.web.controller;\r\npublic class HelloWorldLastModifiedCacheController \r\n\textends AbstractController implements LastModified {\r\n\tprivate long lastModified;\r\n\tprotected ModelAndView handleRequestInternal(HttpServletRequest req, \r\n\t\tHttpServletResponse resp) throws Exception {\r\n\t\t\/\/\u70b9\u51fb\u540e\u518d\u6b21\u8bf7\u6c42\u5f53\u524d\u9875\u9762\r\n\t\tresp.getWriter().write(&quot;&lt;a href=&#039;&#039;&gt;this&lt;\/a&gt;&quot;);\r\n\t\treturn null;\r\n\t}\r\n\tpublic long getLastModified(HttpServletRequest request) {\r\n\t\tif(lastModified == 0L) {\r\n\t\t\t\/\/TODO \u6b64\u5904\u66f4\u65b0\u7684\u6761\u4ef6\uff1a\u5982\u679c\u5185\u5bb9\u6709\u66f4\u65b0\uff0c\u5e94\u8be5\u91cd\u65b0\u8fd4\u56de\u5185\u5bb9\u6700\u65b0\u4fee\u6539\u7684\u65f6\u95f4\u6233\r\n\t\t\tlastModified = System.currentTimeMillis();\r\n\t\t}\r\n\t\treturn lastModified;\r\n\t}\t\r\n}<\/pre>\n<pre class=\"brush:xml;\">\r\n&lt;!&mdash; \u5728chapter4-servlet.xml\u914d\u7f6e\u5904\u7406\u5668 --&gt;   \r\n&lt;bean name=&quot;\/helloLastModified&quot; class=&quot;com.xttblog.web.controller.HelloWorldLastModifiedCacheController&quot;\/&gt;<\/pre>\n<p>\n\tHelloWorldLastModifiedCacheController\u53ea\u9700\u8981\u5b9e\u73b0LastModified\u63a5\u53e3\u7684getLastModified\u65b9\u6cd5\uff0c\u4fdd\u8bc1\u5f53\u5185\u5bb9\u53d1\u751f\u6539\u53d8\u65f6\u8fd4\u56de\u6700\u65b0\u7684\u4fee\u6539\u65f6\u95f4\u5373\u53ef\u3002\n<\/p>\n<p>\n\t\u53d1\u9001\u8bf7\u6c42\u5230\u670d\u52a1\u5668\uff0c\u5982\uff08http:\/\/localhost:9080\/springmvc-chapter4\/helloLastModified\uff09\uff0c\u5219\u670d\u52a1\u5668\u8fd4\u56de\u7684\u54cd\u5e94\u4e3a\uff1a\n<\/p>\n<p>\n\t<img decoding=\"async\" alt=\"spring MVC Last-Modified\" src=\"http:\/\/ocuzluml6.bkt.clouddn.com\/e1.JPG\" style=\"width: 860px;height: 290px\" \/>\n<\/p>\n<p>\n\t\u518d\u6b21\u6309F5\u5237\u65b0\u5ba2\u6237\u7aef\uff0c\u8fd4\u56de\u72b6\u6001\u7801304\u8868\u793a\u670d\u52a1\u5668\u6ca1\u6709\u66f4\u65b0\u8fc7\uff1a\n<\/p>\n<p>\n\t<img decoding=\"async\" alt=\"http \u8fd4\u56de\u72b6\u6001\u7801304\" src=\"http:\/\/ocuzluml6.bkt.clouddn.com\/f1.JPG\" style=\"width: 860px;height: 297px\" \/>\n<\/p>\n<p>\n\t\u91cd\u542f\u670d\u52a1\u5668\uff0c\u518d\u6b21\u5237\u65b0\uff0c\u4f1a\u770b\u5230200\u72b6\u6001\u7801\uff08\u56e0\u4e3a\u670d\u52a1\u5668\u7684lastModified\u65f6\u95f4\u53d8\u4e86\uff09\u3002\n<\/p>\n<p>\n\tSpring\u5224\u65ad\u662f\u5426\u8fc7\u671f\uff0c\u901a\u8fc7\u5982\u4e0b\u4ee3\u7801\uff0c\u5373\u8bf7\u6c42\u7684&ldquo;If-Modified-Since&rdquo; \u5927\u4e8e\u7b49\u4e8e\u5f53\u524d\u7684getLastModified\u65b9\u6cd5\u7684\u65f6\u95f4\u6233\uff0c\u5219\u8ba4\u4e3a\u6ca1\u6709\u4fee\u6539\uff1a<br \/>\n\tthis.notModified = (ifModifiedSince &gt;= (lastModifiedTimestamp \/ 1000 * 1000));\n<\/p>\n<h2>\n\tETag\uff08\u5b9e\u4f53\u6807\u8bb0\uff09\u7f13\u5b58\u673a\u5236<br \/>\n<\/h2>\n<ol>\n<li>\n\t\t\u6d4f\u89c8\u5668\u7b2c\u4e00\u6b21\u8bf7\u6c42\uff0c\u670d\u52a1\u5668\u5728\u54cd\u5e94\u65f6\u7ed9\u8bf7\u6c42URL\u6807\u8bb0\uff0c\u5e76\u5728HTTP\u54cd\u5e94\u5934\u4e2d\u5c06\u5176\u4f20\u9001\u5230\u5ba2\u6237\u7aef\uff0c\u7c7b\u4f3c\u670d\u52a1\u5668\u7aef\u8fd4\u56de\u7684\u683c\u5f0f\uff1a&ldquo;ETag:&quot;0f8b0c86fe2c0c7a67791e53d660208e3&quot;&rdquo;\n\t<\/li>\n<li>\n\t\t\u6d4f\u89c8\u5668\u7b2c\u4e8c\u6b21\u8bf7\u6c42\uff0c\u5ba2\u6237\u7aef\u7684\u67e5\u8be2\u66f4\u65b0\u683c\u5f0f\u662f\u8fd9\u6837\u7684\uff1a&ldquo;If-None-Match:&quot;0f8b0c86fe2c0c7a67791e53d660208e3&quot;&rdquo;\uff0c\u5982\u679cETag\u6ca1\u6539\u53d8\uff0c\u8868\u793a\u5185\u5bb9\u6ca1\u6709\u53d1\u751f\u6539\u53d8\uff0c\u5219\u8fd4\u56de\u72b6\u6001304\u3002\n\t<\/li>\n<\/ol>\n<p>\n\tSpring\u4e5f\u63d0\u4f9b\u4e86\u5bf9ETag\u7684\u652f\u6301\uff0c\u5177\u4f53\u9700\u8981\u5728web.xml\u4e2d\u914d\u7f6e\u5982\u4e0b\u4ee3\u7801\uff1a\n<\/p>\n<pre class=\"brush:xml;\">\r\n&lt;filter&gt;\r\n   &lt;filter-name&gt;etagFilter&lt;\/filter-name&gt;\r\n   &lt;filter-class&gt;org.springframework.web.filter.ShallowEtagHeaderFilter&lt;\/filter-class&gt;\r\n&lt;\/filter&gt;\r\n&lt;filter-mapping&gt;\r\n   &lt;filter-name&gt;etagFilter&lt;\/filter-name&gt;\r\n   &lt;servlet-name&gt;chapter4&lt;\/servlet-name&gt;\r\n&lt;\/filter-mapping&gt;<\/pre>\n<p>\n\t\u6b64\u8fc7\u6ee4\u5668\u53ea\u8fc7\u6ee4\u5230\u6211\u4eecDispatcherServlet\u7684\u8bf7\u6c42\u3002\n<\/p>\n<p>\n\t\u53d1\u9001\u8bf7\u6c42\u5230\u670d\u52a1\u5668\uff1a&ldquo;http:\/\/localhost:9080\/springmvc-chapter4\/hello&rdquo;\uff0c\u670d\u52a1\u5668\u8fd4\u56de\u7684\u54cd\u5e94\u5934\u4e2d\u6dfb\u52a0\u4e86\uff08ETag:&quot;0f8b0c86fe2c0c7a67791e53d660208e3&quot;\uff09\n<\/p>\n<p>\n\t<img decoding=\"async\" alt=\"ETag\uff08\u5b9e\u4f53\u6807\u8bb0\uff09\u7f13\u5b58\u673a\u5236\" src=\"http:\/\/ocuzluml6.bkt.clouddn.com\/g1.JPG\" style=\"width: 860px;height: 358px\" \/>\n<\/p>\n<p>\n\t\u6d4f\u89c8\u5668\u518d\u6b21\u53d1\u9001\u8bf7\u6c42\u5230\u670d\u52a1\u5668\uff08\u6309F5\u5237\u65b0\uff09\uff0c\u8bf7\u6c42\u5934\u4e2d\u6dfb\u52a0\u4e86&ldquo;If-None-Match:<br \/>\n\t&quot;0f8b0c86fe2c0c7a67791e53d660208e3&quot;&rdquo;\uff0c\u54cd\u5e94\u8fd4\u56de304\u4ee3\u7801\uff0c\u8868\u793a\u670d\u52a1\u5668\u6ca1\u6709\u4fee\u6539\uff0c\u5e76\u4e14\u54cd\u5e94\u5934\u518d\u6b21\u6dfb\u52a0\u4e86&ldquo;ETag:&quot;0f8b0c86fe2c0c7a67791e53d660208e3&quot;&rdquo;\uff08\u6bcf\u6b21\u90fd\u9700\u8981\u8ba1\u7b97\uff09\uff1a\n<\/p>\n<p>\n\t<img decoding=\"async\" alt=\"If-None-Match\" src=\"http:\/\/ocuzluml6.bkt.clouddn.com\/h1.JPG\" style=\"width: 860px;height: 374px\" \/>\n<\/p>\n<p>\n\t\u90a3\u670d\u52a1\u5668\u7aef\u662f\u5982\u4f55\u8ba1\u7b97ETag\u7684\u5462\uff1f\n<\/p>\n<pre class=\"brush:java;\">\r\nprotected String generateETagHeaderValue(byte[] bytes) {\r\n\tStringBuilder builder = new StringBuilder(&quot;\\&quot;0&quot;);\r\n\tDigestUtils.appendMd5DigestAsHex(bytes, builder);\r\n\tbuilder.append(&#039;&quot;&#039;);\r\n\treturn builder.toString();\r\n}<\/pre>\n<p>\n\tbytes\u662fresponse\u8981\u5199\u56de\u5230\u5ba2\u6237\u7aef\u7684\u54cd\u5e94\u4f53\uff08\u5373\u54cd\u5e94\u7684\u5185\u5bb9\u6570\u636e\uff09\uff0c\u662f\u901a\u8fc7MD5\u7b97\u6cd5\u8ba1\u7b97\u7684\u5185\u5bb9\u7684\u6458\u8981\u4fe1\u606f\u3002\u4e5f\u5c31\u662f\u8bf4\u5982\u679c\u670d\u52a1\u5668\u5185\u5bb9\u4e0d\u53d1\u751f\u6539\u53d8\uff0c\u5219ETag\u6bcf\u6b21\u90fd\u662f\u4e00\u6837\u7684\uff0c\u5373\u670d\u52a1\u5668\u7aef\u7684\u5185\u5bb9\u6ca1\u6709\u53d1\u751f\u6539\u53d8\u3002\n<\/p>\n<p>\n\t\u7f13\u5b58\u7684\u76ee\u7684\u662f\u51cf\u5c11\u76f8\u5e94\u5ef6\u8fdf \u548c \u51cf\u5c11\u7f51\u7edc\u5e26\u5bbd\u6d88\u8017\uff0c\u6bd4\u5982css\u3001js\u3001\u56fe\u7247\u8fd9\u7c7b\u9759\u6001\u8d44\u6e90\u5e94\u8be5\u8fdb\u884c\u7f13\u5b58\u3002<br \/>\n\t\u5b9e\u9645\u9879\u76ee\u4e00\u822c\u4f7f\u7528\u53cd\u5411\u4ee3\u7406\u670d\u52a1\u5668\uff08\u5982nginx\u3001apache\u7b49\uff09\u8fdb\u884c\u7f13\u5b58\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=1643\">\u8be6\u89e3 Spring MVC \u4e2d\u7684 cacheSeconds \u548c Last-Modified<\/a><\/p><!-- <div class=\"bd-reward-stl\"><button id=\"bdRewardBtn\"><span><\/span><\/button><\/div> -->","protected":false},"excerpt":{"rendered":"<p>\u5173\u4e8e Session \u540c\u6b65\u4e00\u822c\u5728 SSO \u5355\u70b9\u767b\u5f55\u4e2d\u4f1a\u7528\u5230\u3002\u5728 Struts2 \u4e2d\u6211\u4eec\u4e00\u822c\u91c7\u7528\u7684\u90fd\u662f Serv [&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":[1369,1371,1370,1350,1359],"class_list":["post-1643","post","type-post","status-publish","format-standard","hentry","category-java","tag-cacheseconds","tag-etag","tag-last-modified","tag-spring-mvc","tag-spring-mvc-"],"_links":{"self":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/1643","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=1643"}],"version-history":[{"count":2,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/1643\/revisions"}],"predecessor-version":[{"id":1645,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/1643\/revisions\/1645"}],"wp:attachment":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1643"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1643"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1643"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}