{"id":31959,"date":"2024-11-25T12:08:21","date_gmt":"2024-11-25T04:08:21","guid":{"rendered":"https:\/\/fwq.ai\/blog\/31959\/"},"modified":"2024-11-25T12:08:21","modified_gmt":"2024-11-25T04:08:21","slug":"%e4%bb%8b%e7%bb%8decshop%e6%b8%85%e9%99%a4mysql%e7%bc%93%e5%ad%98","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/31959\/","title":{"rendered":"\u4ecb\u7ecdecshop\u6e05\u9664mysql\u7f13\u5b58"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202103\/15\/2021031510231131423.jpg\" class=\"aligncenter\" title=\"\u4ecb\u7ecdecshop\u6e05\u9664mysql\u7f13\u5b58\u63d2\u56fe\" alt=\"\u4ecb\u7ecdecshop\u6e05\u9664mysql\u7f13\u5b58\u63d2\u56fe\" \/><\/p>\n<p>ECSHOP\u7684\u7f13\u5b58\u5b58\u653e\u5728templates\/caches\/\u6587\u7ae0\u5939\u4e0b\uff0c\u65f6\u95f4\u957f\u4e86\u8fd9\u4e2a\u6587\u4ef6\u5939\u5c31\u4f1a\u975e\u5e38\u5e9e\u5927\uff0c\u62d6\u6162\u7f51\u7ad9\u901f\u5ea6\u3002\u8fd8\u6709\u5f88\u591a\u60c5\u51b5\u6211\u4eec\u4e0d\u9700\u8981\u4ed6\u7684\u7f13\u5b58\u3002\u672c\u6587\u4ecb\u7ecd\u7981\u7528ECSHOP\u7f13\u5b58\u7684\u65b9\u6cd5\u3002<\/p>\n<p>ECSHOP\u7684\u7f13\u5b58\u6709\u4e24\u90e8\u5206\uff0c\u4e00\u90e8\u5206\u662fSMARTY\u7684\u9875\u9762\u7f13\u5b58\uff1b\u53e6\u4e00\u90e8\u5206\u662fSQL\u67e5\u8be2\u7ed3\u679c\u7684\u7f13\u5b58\u3002\u8fd9\u4e24\u90e8\u5206\u90fd\u662f\u4fdd\u5b58\u5728templates\/caches\/\u6587\u4ef6\u5939\u4e0b\u3002\u53ea\u8981\u6211\u4eec\u5206\u522b\u5173\u95ed\u8fd9\u4e24\u4e2a\u529f\u80fd\uff0c\u5c31\u53ef\u4ee5\u5b8c\u5168\u7981\u7528ECSHOP\u7684\u7f13\u5b58\u3002\u5f53\u7136\u4f60\u4e5f\u53ef\u4ee5\u6839\u636e\u81ea\u5df1\u7684\u9700\u8981\u5173\u95ed\u5176\u4e2d\u67d0\u4e00\u4e2a\u3002<\/p>\n<p><strong>\u63a8\u8350\uff08\u514d\u8d39\uff09\uff1a<\/strong><\/p>\n<p><strong>\uff11\u3001\u5173\u95edSMARTY\u7684\u7f13\u5b58<\/strong><\/p>\n<p>\u6253\u5f00includes\/cls_template.php\uff0c\u627e\u5230\u4e0b\u9762\u4e00\u6bb5<\/p>\n<pre>if&nbsp;(file_put_contents($this-&amp;gt;cache_dir&nbsp;.&nbsp;\u2018\/\u2019&nbsp;.&nbsp;$cachename&nbsp;.&nbsp;\u2018.php\u2019,&nbsp;\u2018&lt;?php  exit;?&gt;\u2019&nbsp;.&nbsp;$data&nbsp;.&nbsp;$out)&nbsp;===&nbsp;false)\n{\ntrigger_error(\u2018can\u2019t&nbsp;write:\u2019&nbsp;.&nbsp;$this-&amp;gt;cache_dir&nbsp;.&nbsp;\u2018\/\u2019&nbsp;.&nbsp;$cachename&nbsp;.&nbsp;\u2018.php\u2019);\n}<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>&#8211;\u5c06\u6b64\u4ee3\u7801\u6ce8\u91ca\u6389<\/p>\n<p><strong>\uff12\u3001\u5173\u95edSQL\u67e5\u8be2\u7ed3\u679c\u7f13\u5b58<\/strong><\/p>\n<p>\u6253\u5f00includes\/cls_mysql.php<\/p>\n<p>\u627e\u5230<\/p>\n<pre>var&nbsp;$max_cache_time=3600;\/\/\u6700\u5927\u7684\u7f13\u5b58\u65f6\u95f4\uff0c\u4ee5\u79d2\u4e3a\u5355\u4f4d<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u6539\u4e3a<\/p>\n<pre>var&nbsp;$max_cache_time=0;\/\/\u6700\u5927\u7684\u7f13\u5b58\u65f6\u95f4\uff0c\u4ee5\u79d2\u4e3a\u5355\u4f4d<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u5982\u4f55\u9650\u5236\u6216\u7981\u7528ECShop\u7f13\u5b58\u5462\uff1f\u6309\u9053\u7406\u53ea\u8981ftp\u767b\u5f55\u5230\u4e3b\u673a\u7a7a\u95f4\u670d\u52a1\u5668\uff0c\u6e05\u9664\u201ctemplates\/caches\u201d\u6587\u4ef6\u5939\u4e0b\u7684\u7f13\u5b58\u6587\u4ef6\uff0c\u4f46\u6bd4\u8f83\u5b89\u5168\u7a33\u59a5\u7684\u529e\u6cd5\u662f\u8fdb\u5165ecshop\u7f51\u5e97\u540e\u53f0\u70b9\u51fb\u53f3\u4e0a\u89d2\u201c\u6e05\u9664\u7f13\u5b58\u201d\u6309\u94ae\u3002\u8fd8\u662f\u5b8c\u5168\u7981\u7528ecshop\u7684\u7f13\u5b58\u529f\u80fd\u3002<\/p>\n<p><strong>\u4e00\u3001\u7981\u7528ecshop\u90e8\u5206\u6570\u636e\u8868\u7f13\u5b58<\/strong><\/p>\n<p>ecshop\u91cccaches\u6587\u4ef6\u5939\u7f13\u5b58\u6587\u4ef6\u5305\u62ecsql\u67e5\u8be2\u7ed3\u679c\u7f13\u5b58\u548cSMARTY\u6a21\u677f\u9875\u9762\u7f13\u5b58\u3002\u5982\u679c\u8bbf\u95ee\u7f51\u7ad9\u7684\u7528\u6237\u4e00\u591a\uff0c\u8fd9\u4e9b\u4e34\u65f6\u7684\u7f13\u5b58\u6570\u636e\u90fd\u88ab\u4fdd\u6301\u5728ECshop\u7684\u201ctemplates\/caches\u201d\u6587\u4ef6\u5939\u4e0b\u3002\u6570\u636e\u7f13\u5b58\u5bf9\u63d0\u9ad8\u7f51\u5e97\u901f\u5ea6\u6709\u4e00\u5b9a\u4f5c\u7528\uff0c\u4f46\u7f13\u5b58\u6587\u4ef6\u4e00\u591a\u4e5f\u5c31\u8fc7\u72b9\u4e0d\u53ca\u3002\u6709\u4eba\u8bf4\u53ea\u5bf9favourable_activity,goods_activity\u8fd92\u4e2a\u8868\u7981\u7528\u7f13\u5b58\u5373\u53ef\u3002<\/p>\n<p>\u6253\u5f00include\/init.php\uff0c\u627e\u5230<\/p>\n<p>PHP\u4ee3\u7801<\/p>\n<pre>$db-&amp;gt;set_disable_cache_tables(array($ecs-&amp;gt;table(\u2019sessions\u2019),&nbsp;$ecs-&amp;gt;table(\u2019sessions_data\u2019),&nbsp;$ecs-&amp;gt;table(\u2019cart\u2019)));<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u4fee\u6539\u4e3a<\/p>\n<p>PHP\u4ee3\u7801<\/p>\n<pre>$db-&amp;gt;set_disable_cache_tables(array($ecs-&amp;gt;table(\u2019sessions\u2019),&nbsp;$ecs-&amp;gt;table(\u2019sessions_data\u2019),&nbsp;$ecs-&amp;gt;table(\u2019cart\u2019),&nbsp;$ecs-&amp;gt;table(\u2019favourable_activity\u2019),&nbsp;$ecs-&amp;gt;table(\u2019goods_activity\u2019)));<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>\u4e8c\u3001\u5b8c\u5168\u7981\u7528ecshop\u7f13\u5b58<\/strong><\/p>\n<p>\u5b9a\u671f\u8981\u767b\u5f55ecshop\u7f51\u5e97\u540e\u53f0\u6e05\u9664\u7f13\u5b58\u6587\u4ef6\uff0c\u5bf9\u4e8e\u61d2\u4eba\u6765\u8bf4\uff0c\u8fd9\u4e5f\u633a\u5acc\u9ebb\u70e6\u7684\u3002\u90a3\u5e72\u8106\u5b8c\u5168\u7981\u7528ecshop\u7f13\u5b58\u5427\u3002\u53c2\u8003\u5c0f\u866b\u7684\u7981\u7528echsop\u7f13\u5b58\u6587\u7ae0\uff0c\u5c0f\u866b\u7684\u5177\u4f53\u4ee3\u7801\u662f2.6.0\u5de6\u53f3\u7684\u7248\u672c\u30022.7\u7684ecshop\u7981\u7528\u7f13\u5b58\u4fee\u6539\u65b9\u6cd5\u7c7b\u4f3c\uff1a<\/p>\n<p>1. \u7528editplus\u6253\u5f00include\/cls_template.php\uff0c\u628a\u4e0b\u9762\u4ee3\u7801\u6ce8\u91ca\u6389\uff1a<\/p>\n<p>PHP\u4ee3\u7801<\/p>\n<p>2.\u7528editplus\u6253\u5f00include\/cls_mysql.php\uff0c\u627e\u5230 max_cache_time = 300\uff0c\u628a300\u6539\u4e3a0\u5373\u53ef<\/p>\n<p><strong>\u4e09\u3001templates\/compiled\u4e0b\u7684\u6587\u4ef6\u662f\u5426\u53ef\u4ee5\u6e05\u7a7a?<\/strong><\/p>\n<p>templates\/compiled\u4e0b\u7684\u6587\u4ef6\u662f\u6a21\u677f\u7f16\u8bd1\u540e\u6587\u4ef6\uff0c\u53ef\u4ee5\u6e05\u7a7a\u3002\u5f53\u7528\u6237\u6d4f\u89c8\u7f51\u5e97\u540e\u53c8\u4f1a\u91cd\u65b0\u751f\u6210\u3002templates\u6587\u4ef6\u5939\u4e0b\u7684\u4e3b\u8981\u662fcaches\u91cc\u7f13\u5b58\u6587\u4ef6\u592a\u591a\uff0c\u4f60\u53ef\u4ee5\u5b9a\u671f\u6e05\u7a7a\u6216\u5b8c\u5168\u7981\u7528ecshop\u7f13\u5b58\u3002<\/p>\n<p>\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d<\/p>\n<p>\u5173\u4e8e\u6e05\u9664\u7f13\u5b58\u7684\u5efa\u8bae!!<\/p>\n<p>\u53d1\u73b0\u73b0\u5728\u7684\u6e05\u9664\u7f13\u5b58\u505a\u7684\u6bd4\u8f83\u7c97!\u548c\u4e4b\u524d\u6ca1\u5927\u53d8\u5316\u554a!\u548c2.0.5\u4e00\u6837.<\/p>\n<p>\u53ea\u8981\u540e\u53f0\u968f\u4fbf\u4e00\u4e2a\u4fee\u6539\u7684\u64cd\u4f5c,\u6574\u4e2a\u7f13\u5b58\u5c31\u90fd\u6ca1\u4e86!\u7528\u7684\u90fd\u662f$smarty-&gt;clear_all_cache();<\/p>\n<p>\u7f3a\u70b9:\u5982\u679c\u6211\u670910\u4e07\u5546\u54c1,\u800c\u4e14\u90fd\u88ab\u6d4f\u89c8\u8fc7,\u6211\u540e\u53f0\u4e00\u4e2a\u64cd\u4f5c\u5c31\u8981\u6e05\u695a15\u4e07\u591a\u7f13\u5b58\u6587\u4ef6:)\u4f3c\u4e4e\u6781\u9650\u4e86\u70b9<\/p>\n<p>\u53ea\u662f\u4e3e\u4f8b!!,\u5e0c\u671bECSHOP\u66f4\u52a0\u5b8c\u7f8e\u800c\u5df2!<\/p>\n<p>smarty\u91cc\u9762\u4e0d\u662f\u6709\u8fd9\u4e2a\u51fd\u6570\u4e48?<\/p>\n<p>clear_cache(),\u6211\u5c0f\u4fee\u6539\u4e86\u4e0b,\u589e\u52a0\u4e86\u53ef\u4ee5\u6307\u5b9a\u5220\u9664\u67d0\u4e2a\u76ee\u5f55\u4e0b\u7684\u7f13\u5b58,\u7528\u5904\u662f:\u53ef\u65b9\u4fbf\u7684\u5220\u9664\u5546\u54c1\u7684\u5206\u7c7b\u7f13\u5b58!<\/p>\n<p>2.0.5\u4e0a\u6211\u662f\u8fd9\u4e48\u6539\u7684,\u53e6\u5916\u5728\u6839\u76ee\u5f55\u5efa\u7acb\u4e00\u4e2a\u7f13\u5b58\u76ee\u5f55templates_caches,\u91cc\u9762\u5efa\u7acbarticle,article_cat,goods,goods_cat,4\u4e2a\u6587\u4ef6\u5939\u5206\u522b\u653e\u6587\u7ae0\u5185\u5bb9,\u6587\u7ae0\u5217\u8868,\u5546\u54c1\u5185\u5bb9,\u5546\u54c1\u5217\u8868\u7684\u7f13\u5b58<\/p>\n<p>\u4f8b\u5b50:\u5bf9\u5546\u54c1,\u6587\u7ae0\u90e8\u5206\u7684\u4fee\u6539<\/p>\n<p>\u524d\u53f0init.php\u548c\u540e\u53f0init.php\u52a0\u5165\u5982\u4e0b\u4ee3\u7801,\u6211\u4e3a\u4e86\u65b9\u4fbf\u76f4\u63a5\u52a0\u5728config.php\u91cc\u9762\u4e86<\/p>\n<pre>\/\/\u7f13\u5b58\u76ee\u5f55\u8bbe\u7f6e\ndefine('ECS_ROOT',&nbsp;substr(dirname(__FILE__),&nbsp;0,&nbsp;-8));\/\/\u524d\u540e\u53f0\u6570\u5b57\u5f53\u7136\u4e0d\u4e00\u6837\u4e86:)\n\/\/\u6587\u7ae0\u7f13\u5b58\n$cache_dir_article&nbsp;=&nbsp;ECS_ROOT.'.\/templates_caches\/article';\n$cache_dir_article_cat&nbsp;=&nbsp;ECS_ROOT.'.\/templates_caches\/article_cat';\n\/\/\u5546\u54c1\u7f13\u5b58\n$cache_dir_goods&nbsp;=&nbsp;ECS_ROOT.'.\/templates_caches\/goods';\n$cache_dir_goods_cat&nbsp;=&nbsp;ECS_ROOT.'.\/templates_caches\/goods_cat';<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u524d\u53f0\u5546\u54c1\u5185\u5bb9\u548c\u5206\u7c7b\u7f13\u5b58\u65f6\u95f4\u5355\u72ec\u8bbe\u7f6e\u957f\u4e00\u4e9b,\u5982\u5185\u5bb9\u4e00\u4e2a\u6708,\u5206\u7c7b1\u5929<\/p>\n<p>\u4fee\u6539\u540e\u53f0,\u5546\u54c1\u5355\u72ec\u4fee\u6539\u7684\u5730\u65b9\u53ea\u5220\u9664\u8fd9\u4e2a\u5546\u54c1\u5185\u5bb9\u7684\u7f13\u5b58<\/p>\n<p>\u53ea\u8981\u6709\u4fee\u6539\u64cd\u4f5c\u5c31\u5220\u9664\u5546\u54c1\u5206\u7c7b\u7f13\u5b58\u548c\u9996\u9875\u7f13\u5b58!\u52a0\u5165\u5982\u4e0b<\/p>\n<pre>$smarty-&amp;gt;clear_cache(null,&nbsp;null,&nbsp;null,&nbsp;null,&nbsp;$cache_dir_goods_cat);\/\/zouql:\u5220\u9664\u5546\u54c1\u76ee\u5f55\u7f13\u5b58,\u9ed8\u8ba4\u7f13\u5b58\u65f6\u95f4\n$smarty-&amp;gt;clear_cache('goods.html',&nbsp;$goods_id,&nbsp;null,&nbsp;null,&nbsp;$cache_dir_goods);\/\/zouql:\u5220\u9664\u5546\u54c1\u7f13\u5b58,\u9ed8\u8ba4\u7f13\u5b58\u65f6\u95f4<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u8fd8\u6709\u5e7f\u544a\u7ba1\u7406\u7b49\u7b49\u7b49\u7b49\u7b49\u7b49\u7b49\u7b49\u5730\u65b9\u8981\u6539!<\/p>\n<p>\u524d\u53f0\u7528\u6237\u53d1\u8868\u8bc4\u8bba\u540e\u81ea\u52a8\u5220\u9664\u672c\u5546\u54c1\u7f13\u5b58\u7b49\u7b49&#8230;&#8230;&#8230;.<\/p>\n<pre>function&nbsp;clear_cache($tpl_file&nbsp;=&nbsp;null,&nbsp;$cache_id&nbsp;=&nbsp;null,&nbsp;$compile_id&nbsp;=&nbsp;null,&nbsp;$exp_time&nbsp;=&nbsp;null,&nbsp;$cache_dir&nbsp;=&nbsp;null)\n{\nif&nbsp;(!isset($cache_dir))\n$cache_dir&nbsp;=&nbsp;$this-&amp;gt;cache_dir;\nif&nbsp;(!isset($compile_id))\n$compile_id&nbsp;=&nbsp;$this-&amp;gt;compile_id;\nif&nbsp;(!isset($tpl_file))\n$compile_id&nbsp;=&nbsp;null;\n$_auto_id&nbsp;=&nbsp;$this-&amp;gt;_get_auto_id($cache_id,&nbsp;$compile_id);\nif&nbsp;(!empty($this-&amp;gt;cache_handler_func))&nbsp;{\nreturn&nbsp;call_user_func_array($this-&amp;gt;cache_handler_func,\narray('clear',&nbsp;&amp;amp;$this,&nbsp;&amp;amp;$dummy,&nbsp;$tpl_file,&nbsp;$cache_id,&nbsp;$compile_id,&nbsp;$exp_time));\n}&nbsp;else&nbsp;{\n$_params&nbsp;=&nbsp;array('auto_base'&nbsp;=&amp;gt;&nbsp;$cache_dir,\n'auto_source'&nbsp;=&amp;gt;&nbsp;$tpl_file,\n'auto_id'&nbsp;=&amp;gt;&nbsp;$_auto_id,\n'exp_time'&nbsp;=&amp;gt;&nbsp;$exp_time);\nrequire_once(SMARTY_CORE_DIR&nbsp;.&nbsp;'core.rm_auto.php');\nreturn&nbsp;smarty_core_rm_auto($_params,&nbsp;$this);\n}\n}<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u4ecb\u7ecdecshop\u6e05\u9664mysql\u7f13\u5b58\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>ECSHOP\u7684\u7f13\u5b58\u5b58\u653e\u5728templates\/caches\/\u6587\u7ae0\u5939\u4e0b\uff0c\u65f6\u95f4\u957f\u4e86\u8fd9\u4e2a\u6587\u4ef6\u5939\u5c31\u4f1a\u975e\u5e38\u5e9e\u5927\uff0c\u62d6\u6162\u7f51\u7ad9\u901f\u5ea6\u3002\u8fd8\u6709\u5f88\u591a\u60c5\u51b5\u6211\u4eec\u4e0d\u9700\u8981\u4ed6\u7684\u7f13\u5b58\u3002\u672c\u6587\u4ecb\u7ecd\u7981\u7528ECSHOP\u7f13\u5b58\u7684\u65b9\u6cd5\u3002 ECSHOP\u7684\u7f13\u5b58\u6709\u4e24\u90e8\u5206\uff0c\u4e00\u90e8\u5206\u662fSMARTY\u7684\u9875\u9762\u7f13\u5b58\uff1b\u53e6\u4e00\u90e8\u5206\u662fSQL\u67e5\u8be2\u7ed3\u679c\u7684\u7f13\u5b58\u3002\u8fd9\u4e24\u90e8\u5206\u90fd\u662f\u4fdd\u5b58\u5728templates\/caches\/\u6587\u4ef6\u5939\u4e0b\u3002\u53ea\u8981\u6211\u4eec\u5206\u522b\u5173\u95ed\u8fd9\u4e24\u4e2a\u529f\u80fd\uff0c\u5c31\u53ef\u4ee5\u5b8c\u5168\u7981\u7528ECSHOP\u7684\u7f13\u5b58\u3002\u5f53\u7136\u4f60\u4e5f\u53ef\u4ee5\u6839\u636e\u81ea\u5df1\u7684\u9700\u8981\u5173\u95ed\u5176\u4e2d\u67d0\u4e00\u4e2a\u3002 \u63a8\u8350\uff08\u514d\u8d39\uff09\uff1a \uff11\u3001\u5173\u95edSMARTY\u7684\u7f13\u5b58 \u6253\u5f00includes\/cls_template.php\uff0c\u627e\u5230\u4e0b\u9762\u4e00\u6bb5 if&nbsp;(file_put_contents($this-&amp;gt;cache_dir&nbsp;.&nbsp;\u2018\/\u2019&nbsp;.&nbsp;$cachename&nbsp;.&nbsp;\u2018.php\u2019,&nbsp;\u2018&lt;?php exit;?&gt;\u2019&nbsp;.&nbsp;$data&nbsp;.&nbsp;$out)&nbsp;===&nbsp;false) { trigger_error(\u2018can\u2019t&nbsp;write:\u2019&nbsp;.&nbsp;$this-&amp;gt;cache_dir&nbsp;.&nbsp;\u2018\/\u2019&nbsp;.&nbsp;$cachename&nbsp;.&nbsp;\u2018.php\u2019); } \u767b\u5f55\u540e\u590d\u5236 &#8211;\u5c06\u6b64\u4ee3\u7801\u6ce8\u91ca\u6389 \uff12\u3001\u5173\u95edSQL\u67e5\u8be2\u7ed3\u679c\u7f13\u5b58 \u6253\u5f00includes\/cls_mysql.php \u627e\u5230 var&nbsp;$max_cache_time=3600;\/\/\u6700\u5927\u7684\u7f13\u5b58\u65f6\u95f4\uff0c\u4ee5\u79d2\u4e3a\u5355\u4f4d \u767b\u5f55\u540e\u590d\u5236 \u6539\u4e3a var&nbsp;$max_cache_time=0;\/\/\u6700\u5927\u7684\u7f13\u5b58\u65f6\u95f4\uff0c\u4ee5\u79d2\u4e3a\u5355\u4f4d \u767b\u5f55\u540e\u590d\u5236 \u5982\u4f55\u9650\u5236\u6216\u7981\u7528ECShop\u7f13\u5b58\u5462\uff1f\u6309\u9053\u7406\u53ea\u8981ftp\u767b\u5f55\u5230\u4e3b\u673a\u7a7a\u95f4\u670d\u52a1\u5668\uff0c\u6e05\u9664\u201ctemplates\/caches\u201d\u6587\u4ef6\u5939\u4e0b\u7684\u7f13\u5b58\u6587\u4ef6\uff0c\u4f46\u6bd4\u8f83\u5b89\u5168\u7a33\u59a5\u7684\u529e\u6cd5\u662f\u8fdb\u5165ecshop\u7f51\u5e97\u540e\u53f0\u70b9\u51fb\u53f3\u4e0a\u89d2\u201c\u6e05\u9664\u7f13\u5b58\u201d\u6309\u94ae\u3002\u8fd8\u662f\u5b8c\u5168\u7981\u7528ecshop\u7684\u7f13\u5b58\u529f\u80fd\u3002 \u4e00\u3001\u7981\u7528ecshop\u90e8\u5206\u6570\u636e\u8868\u7f13\u5b58 ecshop\u91cccaches\u6587\u4ef6\u5939\u7f13\u5b58\u6587\u4ef6\u5305\u62ecsql\u67e5\u8be2\u7ed3\u679c\u7f13\u5b58\u548cSMARTY\u6a21\u677f\u9875\u9762\u7f13\u5b58\u3002\u5982\u679c\u8bbf\u95ee\u7f51\u7ad9\u7684\u7528\u6237\u4e00\u591a\uff0c\u8fd9\u4e9b\u4e34\u65f6\u7684\u7f13\u5b58\u6570\u636e\u90fd\u88ab\u4fdd\u6301\u5728ECshop\u7684\u201ctemplates\/caches\u201d\u6587\u4ef6\u5939\u4e0b\u3002\u6570\u636e\u7f13\u5b58\u5bf9\u63d0\u9ad8\u7f51\u5e97\u901f\u5ea6\u6709\u4e00\u5b9a\u4f5c\u7528\uff0c\u4f46\u7f13\u5b58\u6587\u4ef6\u4e00\u591a\u4e5f\u5c31\u8fc7\u72b9\u4e0d\u53ca\u3002\u6709\u4eba\u8bf4\u53ea\u5bf9favourable_activity,goods_activity\u8fd92\u4e2a\u8868\u7981\u7528\u7f13\u5b58\u5373\u53ef\u3002 \u6253\u5f00include\/init.php\uff0c\u627e\u5230 PHP\u4ee3\u7801 $db-&amp;gt;set_disable_cache_tables(array($ecs-&amp;gt;table(\u2019sessions\u2019),&nbsp;$ecs-&amp;gt;table(\u2019sessions_data\u2019),&nbsp;$ecs-&amp;gt;table(\u2019cart\u2019))); \u767b\u5f55\u540e\u590d\u5236 \u4fee\u6539\u4e3a PHP\u4ee3\u7801 $db-&amp;gt;set_disable_cache_tables(array($ecs-&amp;gt;table(\u2019sessions\u2019),&nbsp;$ecs-&amp;gt;table(\u2019sessions_data\u2019),&nbsp;$ecs-&amp;gt;table(\u2019cart\u2019),&nbsp;$ecs-&amp;gt;table(\u2019favourable_activity\u2019),&nbsp;$ecs-&amp;gt;table(\u2019goods_activity\u2019))); \u767b\u5f55\u540e\u590d\u5236 \u4e8c\u3001\u5b8c\u5168\u7981\u7528ecshop\u7f13\u5b58 \u5b9a\u671f\u8981\u767b\u5f55ecshop\u7f51\u5e97\u540e\u53f0\u6e05\u9664\u7f13\u5b58\u6587\u4ef6\uff0c\u5bf9\u4e8e\u61d2\u4eba\u6765\u8bf4\uff0c\u8fd9\u4e5f\u633a\u5acc\u9ebb\u70e6\u7684\u3002\u90a3\u5e72\u8106\u5b8c\u5168\u7981\u7528ecshop\u7f13\u5b58\u5427\u3002\u53c2\u8003\u5c0f\u866b\u7684\u7981\u7528echsop\u7f13\u5b58\u6587\u7ae0\uff0c\u5c0f\u866b\u7684\u5177\u4f53\u4ee3\u7801\u662f2.6.0\u5de6\u53f3\u7684\u7248\u672c\u30022.7\u7684ecshop\u7981\u7528\u7f13\u5b58\u4fee\u6539\u65b9\u6cd5\u7c7b\u4f3c\uff1a 1. \u7528editplus\u6253\u5f00include\/cls_template.php\uff0c\u628a\u4e0b\u9762\u4ee3\u7801\u6ce8\u91ca\u6389\uff1a PHP\u4ee3\u7801 2.\u7528editplus\u6253\u5f00include\/cls_mysql.php\uff0c\u627e\u5230 max_cache_time = 300\uff0c\u628a300\u6539\u4e3a0\u5373\u53ef \u4e09\u3001templates\/compiled\u4e0b\u7684\u6587\u4ef6\u662f\u5426\u53ef\u4ee5\u6e05\u7a7a? templates\/compiled\u4e0b\u7684\u6587\u4ef6\u662f\u6a21\u677f\u7f16\u8bd1\u540e\u6587\u4ef6\uff0c\u53ef\u4ee5\u6e05\u7a7a\u3002\u5f53\u7528\u6237\u6d4f\u89c8\u7f51\u5e97\u540e\u53c8\u4f1a\u91cd\u65b0\u751f\u6210\u3002templates\u6587\u4ef6\u5939\u4e0b\u7684\u4e3b\u8981\u662fcaches\u91cc\u7f13\u5b58\u6587\u4ef6\u592a\u591a\uff0c\u4f60\u53ef\u4ee5\u5b9a\u671f\u6e05\u7a7a\u6216\u5b8c\u5168\u7981\u7528ecshop\u7f13\u5b58\u3002 \uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d \u5173\u4e8e\u6e05\u9664\u7f13\u5b58\u7684\u5efa\u8bae!! \u53d1\u73b0\u73b0\u5728\u7684\u6e05\u9664\u7f13\u5b58\u505a\u7684\u6bd4\u8f83\u7c97!\u548c\u4e4b\u524d\u6ca1\u5927\u53d8\u5316\u554a!\u548c2.0.5\u4e00\u6837. \u53ea\u8981\u540e\u53f0\u968f\u4fbf\u4e00\u4e2a\u4fee\u6539\u7684\u64cd\u4f5c,\u6574\u4e2a\u7f13\u5b58\u5c31\u90fd\u6ca1\u4e86!\u7528\u7684\u90fd\u662f$smarty-&gt;clear_all_cache(); \u7f3a\u70b9:\u5982\u679c\u6211\u670910\u4e07\u5546\u54c1,\u800c\u4e14\u90fd\u88ab\u6d4f\u89c8\u8fc7,\u6211\u540e\u53f0\u4e00\u4e2a\u64cd\u4f5c\u5c31\u8981\u6e05\u695a15\u4e07\u591a\u7f13\u5b58\u6587\u4ef6:)\u4f3c\u4e4e\u6781\u9650\u4e86\u70b9 \u53ea\u662f\u4e3e\u4f8b!!,\u5e0c\u671bECSHOP\u66f4\u52a0\u5b8c\u7f8e\u800c\u5df2! smarty\u91cc\u9762\u4e0d\u662f\u6709\u8fd9\u4e2a\u51fd\u6570\u4e48? clear_cache(),\u6211\u5c0f\u4fee\u6539\u4e86\u4e0b,\u589e\u52a0\u4e86\u53ef\u4ee5\u6307\u5b9a\u5220\u9664\u67d0\u4e2a\u76ee\u5f55\u4e0b\u7684\u7f13\u5b58,\u7528\u5904\u662f:\u53ef\u65b9\u4fbf\u7684\u5220\u9664\u5546\u54c1\u7684\u5206\u7c7b\u7f13\u5b58! 2.0.5\u4e0a\u6211\u662f\u8fd9\u4e48\u6539\u7684,\u53e6\u5916\u5728\u6839\u76ee\u5f55\u5efa\u7acb\u4e00\u4e2a\u7f13\u5b58\u76ee\u5f55templates_caches,\u91cc\u9762\u5efa\u7acbarticle,article_cat,goods,goods_cat,4\u4e2a\u6587\u4ef6\u5939\u5206\u522b\u653e\u6587\u7ae0\u5185\u5bb9,\u6587\u7ae0\u5217\u8868,\u5546\u54c1\u5185\u5bb9,\u5546\u54c1\u5217\u8868\u7684\u7f13\u5b58 \u4f8b\u5b50:\u5bf9\u5546\u54c1,\u6587\u7ae0\u90e8\u5206\u7684\u4fee\u6539 \u524d\u53f0init.php\u548c\u540e\u53f0init.php\u52a0\u5165\u5982\u4e0b\u4ee3\u7801,\u6211\u4e3a\u4e86\u65b9\u4fbf\u76f4\u63a5\u52a0\u5728config.php\u91cc\u9762\u4e86 \/\/\u7f13\u5b58\u76ee\u5f55\u8bbe\u7f6e define(&#8216;ECS_ROOT&#8217;,&nbsp;substr(dirname(__FILE__),&nbsp;0,&nbsp;-8));\/\/\u524d\u540e\u53f0\u6570\u5b57\u5f53\u7136\u4e0d\u4e00\u6837\u4e86:) [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18],"tags":[],"class_list":["post-31959","post","type-post","status-publish","format-standard","hentry","category-cms"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/31959","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=31959"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/31959\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=31959"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=31959"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=31959"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}