{"id":1673,"date":"2017-07-21T10:46:09","date_gmt":"2017-07-21T02:46:09","guid":{"rendered":"http:\/\/www.xttblog.com\/?p=1673"},"modified":"2017-07-21T10:46:09","modified_gmt":"2017-07-21T02:46:09","slug":"%e8%af%a6%e8%a7%a3%e6%b5%8f%e8%a7%88%e5%99%a8cache-control%e7%bc%93%e5%ad%98%e7%ad%96%e7%95%a5","status":"publish","type":"post","link":"https:\/\/www.xttblog.com\/?p=1673","title":{"rendered":"\u8be6\u89e3\u6d4f\u89c8\u5668Cache-Control\u7f13\u5b58\u7b56\u7565"},"content":{"rendered":"<p>\n\t\u539f\u6765\u7528\u7684\u662fExpires\u7b56\u7565,\u6d4f\u89c8\u5668\u53ef\u4ee5\u76f4\u63a5\u4ece\u6d4f\u89c8\u5668\u7f13\u5b58\u8bfb\u53d6\u6570\u636e\uff0c\u800c\u65e0\u9700\u518d\u6b21\u8bf7\u6c42\uff0c\u5b83\u7684\u503c\u5bf9\u5e94\u4e00\u4e2aGMT\uff0c\u6765\u544a\u8bc9\u6d4f\u89c8\u5668\u8d44\u6e90\u7f13\u5b58\u8fc7\u671f\u65f6\u95f4\uff0c\u5982\u679c\u8fd8\u6ca1\u8fc7\u8be5\u65f6\u95f4\u70b9\u5219\u4e0d\u53d1\u8bf7\u6c42\u3002\n<\/p>\n<p>\n\t\u4f8b\u5982\u4e0b\u9762\u7684\u4f8b\u5b50,\u8fd9\u662f\u4eac\u4e1c\u7684\u9996\u9875\u91cc\u627e\u7684\u4e00\u4e2a,\u65f6\u95f4\u90fd\u5e72\u52302027\u5e74\u4e86,\u73b0\u5728\u7684\u65f6\u95f4\u662f2017\u5e747\u670820,\u80af\u5b9a\u8fd8\u6ca1\u5230\u5931\u6548\u65f6\u95f4,so\u662f304,\u4f7f\u7528\u672c\u5730\u7f13\u5b58,\u4e5f\u5c31\u662f\u8bf4\u5728\u5931\u6548\u65f6\u95f4\u4e4b\u5185\uff0c\u4e00\u76f4\u4f7f\u7528\u7f13\u5b58,\u9664\u975e\u628a\u7f13\u5b58\u5220\u4e86\u3002\n<\/p>\n<p>\n\t<img decoding=\"async\" alt=\"Expires \u7f13\u5b58\u7b56\u7565\" src=\"http:\/\/ocuzluml6.bkt.clouddn.com\/20170720220607724.png\" style=\"width: 1559px;height: 471px\" \/>\n<\/p>\n<p>\n\t\u4f46\u662f\u8fd9\u662fhttp1.0\u7684\u4e1c\u897f,\u73b0\u5728\u4f7f\u7528\u7684\u662fhttp1.1\u7684,\u8fd9\u4e2a\u53ef\u4ee5\u5ffd\u7565\u4e86\u56e0\u4e3a\u8fd9\u4e2a\u662f\u83b7\u53d6\u7684\u672c\u5730\u7684\u65f6\u95f4,\u6211\u4eec\u6539\u52a8\u7684\u8bdd,\u4f1a\u51fa\u73b0\u95ee\u9898,\u73b0\u5728\u90fd\u7528Cache-control\u4e86\u3002\n<\/p>\n<p>\n\tcache-control\u7b56\u7565\u6709\u7684\u5730\u65b9\u4e5f\u53eb\u65b0\u9c9c\u5ea6\u9650\u503c\u3002\n<\/p>\n<p>\n\t\u8fd9\u4e2a\u548c\u4e0a\u9762\u8bf4\u7684expires\u6548\u679c\u662f\u4e00\u6837\u7684,\u6700\u5927\u65f6\u95f4,\u7528\u6765\u63a7\u5236\u6d4f\u89c8\u5668\u662f\u5426\u76f4\u63a5\u4ece\u6d4f\u89c8\u5668\u7f13\u5b58\u53d6\u6570\u636e\u8fd8\u662f\u91cd\u65b0\u53d1\u8bf7\u6c42\u5230\u670d\u52a1\u5668\u53d6\u6570\u636e\u3002\n<\/p>\n<p>\n\t\u53ea\u4e0d\u8fc7Cache-Control\u7684\u9009\u62e9\u66f4\u591a\uff0c\u8bbe\u7f6e\u66f4\u7ec6\u81f4\uff0c\u5982\u679c\u540c\u65f6\u8bbe\u7f6e\u7684\u8bdd\uff0c\u5176\u4f18\u5148\u7ea7\u9ad8\u4e8eExpires\u3002\n<\/p>\n<p>\n\tCache-Control\u53ef\u62e5\u6709\u5982\u4e0b\u503c\uff1a\n<\/p>\n<ul>\n<li>\n\t\tPublic\uff1a\u6307\u5b9a\u54cd\u5e94\u4f1a\u88ab\u7f13\u5b58\uff0c\u5e76\u4e14\u5728\u591a\u7528\u6237\u95f4\u5171\u4eab\u3002\n\t<\/li>\n<li>\n\t\tPrivate\uff1a\u54cd\u5e94\u53ea\u4f5c\u4e3a\u79c1\u6709\u7684\u7f13\u5b58\uff08\u89c1\u4e0b\u56fe\uff09\uff0c\u4e0d\u80fd\u5728\u7528\u6237\u95f4\u5171\u4eab\u3002\u5982\u679c\u8981\u6c42HTTP\u8ba4\u8bc1\uff0c\u54cd\u5e94\u4f1a\u81ea\u52a8\u8bbe\u7f6e\u4e3aprivate\u3002\u3002\u7f13\u5b58\u53ea\u5f00\u653e\u7ed9\u67d0\u4e9b\u7279\u5b9a\u7684\u7528\u6237\uff0c\u6bd4\u5982\u670d\u52a1\u5668\u7684\u7528\u6237\uff0c\u5176\u4ed6\u7528\u6237\u5219\u4e0d\u80fd\u7f13\u5b58\u8fd9\u4e9b\u6570\u636e\u3002\n\t<\/li>\n<li>\n\t\tno-cache\uff1a\u6307\u5b9a\u4e0d\u7f13\u5b58\u54cd\u5e94\uff0c\u8868\u660e\u8d44\u6e90\u4e0d\u8fdb\u884c\u7f13\u5b58\u3002\n\t<\/li>\n<li>\n\t\tno-store\uff1a\u7528\u4e8e\u9632\u6b62\u91cd\u8981\u7684\u4fe1\u606f\u88ab\u65e0\u610f\u7684\u53d1\u5e03\u3002\u5728\u8bf7\u6c42\u6d88\u606f\u4e2d\u53d1\u9001\u5c06\u4f7f\u5f97\u8bf7\u6c42\u548c\u54cd\u5e94\u6d88\u606f\u90fd\u4e0d\u4f7f\u7528\u7f13\u5b58\uff0c\u5b8c\u5168\u4e0d\u5b58\u4e0b\u4f86\u3002\n\t<\/li>\n<li>\n\t\tmax-age\uff1a\u6307\u793a\u5ba2\u6237\u7aef\u8be5\u7aef\u65f6\u95f4\u5185\u7f13\u5b58\u90fd\u662f\u6700\u65b0\u7684\u3002\u5355\u4f4d\u4e3a\u79d2,\u5c31\u662f\u5728\u8fd9\u4e2a\u65f6\u95f4\u5185,\u4e0d\u4f1a\u8bf7\u6c42\u6570\u636e\u4e86,\u4e00\u76f4\u7528\u7684\u5c31\u662f\u7f13\u5b58\u3002\u6bd4\u5982\uff1aCache-Control\uff1amax-age=3600 \u8868\u793a60\u5206\u949f\u4e4b\u540e\u8fc7\u671f,\u5728\u8fd960\u5206\u949f\u671f\u95f4\u4e0d\u4f1a\u66f4\u65b0\u3002\n\t<\/li>\n<li>\n\t\tmin-fresh \uff1a\u6307\u793a\u5ba2\u6237\u7aef\u5e0c\u671b\u83b7\u53d6\u4e00\u4e2a\u5728\u5c0f\u4e8e\u6307\u5b9a\u7684\u65f6\u95f4\u5185\u88ab\u66f4\u65b0\u8fc7\u7684\u8d44\u6e90\uff0c\u5355\u4f4d\u4e3a\u79d2\uff1a\u4f8b\u5982\uff1aCache-Control\uff1amin-fresh =120 \u3002\u5411\u670d\u52a1\u5668\u83b7\u53d62\u5206\u949f\u5185\u88ab\u66f4\u65b0\u8fc7\u7684\u8d44\u6e90\u3002\n\t<\/li>\n<li>\n\t\tmax-stale\uff1a\u6307\u793a\u5ba2\u6237\u7aef\u53ef\u4ee5\u63a5\u6536\u8d85\u51fa\u8d85\u65f6\u671f\u95f4\u7684\u54cd\u5e94\u6d88\u606f\u3002\u4f8b\u5982\uff1aCache-Control\uff1amax-stale =3600 \uff0c\u5411\u670d\u52a1\u5668\u83b7\u53d6\u8d85\u8fc7\u7f13\u5b58\u65f6\u95f42\u5206\u949f\u7684\u8d44\u6e90\u3002\n\t<\/li>\n<\/ul>\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=1673\">\u8be6\u89e3\u6d4f\u89c8\u5668Cache-Control\u7f13\u5b58\u7b56\u7565<\/a><\/p><!-- <div class=\"bd-reward-stl\"><button id=\"bdRewardBtn\"><span><\/span><\/button><\/div> -->","protected":false},"excerpt":{"rendered":"<p>\u539f\u6765\u7528\u7684\u662fExpires\u7b56\u7565,\u6d4f\u89c8\u5668\u53ef\u4ee5\u76f4\u63a5\u4ece\u6d4f\u89c8\u5668\u7f13\u5b58\u8bfb\u53d6\u6570\u636e\uff0c\u800c\u65e0\u9700\u518d\u6b21\u8bf7\u6c42\uff0c\u5b83\u7684\u503c\u5bf9\u5e94\u4e00\u4e2aGMT\uff0c\u6765\u544a\u8bc9 [&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":[1387,1388,1153,849],"class_list":["post-1673","post","type-post","status-publish","format-standard","hentry","category-java","tag-cache-control","tag-expires","tag-http","tag-849"],"_links":{"self":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/1673","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=1673"}],"version-history":[{"count":1,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/1673\/revisions"}],"predecessor-version":[{"id":1674,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/1673\/revisions\/1674"}],"wp:attachment":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1673"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1673"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1673"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}