diff --git a/framework/base/control.class.php b/framework/base/control.class.php index 0a2d528c64..f56c369f54 100644 --- a/framework/base/control.class.php +++ b/framework/base/control.class.php @@ -735,6 +735,9 @@ class baseControl ob_start(); include $viewFile; if(isset($hookFiles)) foreach($hookFiles as $hookFile) if(file_exists($hookFile)) include $hookFile; + + $this->useClientCache(); + $this->output .= ob_get_contents(); ob_end_clean(); @@ -1033,6 +1036,8 @@ class baseControl ob_start(); include $viewFile; + $this->useClientCache(); + if(!$context->rendered) \zin\renderPage(); $content = ob_get_clean(); @@ -1046,6 +1051,21 @@ class baseControl chdir($currentPWD); } + /** + * 使用客户端缓存。 + * Use client cache. + * + * @access public + * @return void + */ + public function useClientCache() + { + if(!$this->config->cache->client->enable || !$this->app->useClientCache) return; + + helper::setStatus(304); + helper::end(); + } + /** * 直接输出data数据,通常用于ajax请求中。 * Send data directly, for ajax requests.