Skip to content

Commit

Permalink
去掉了资源页面缓存选项
Browse files Browse the repository at this point in the history
  • Loading branch information
gogobody committed Jan 23, 2021
1 parent 31037e9 commit 1c54306
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,7 @@ public static function config(Typecho_Widget_Helper_Form $form)
'author' => '作者',
'search' => '搜索',
'feed' => 'feed',
'page' => '页面',
'resources' => '资源页(没有就不选)'
'page' => '页面'
);
$element = new Typecho_Widget_Helper_Form_Element_Checkbox('cache_page', $list, array('index', 'post', 'search', 'page', 'author', 'tag'), '需要缓存的页面');
$element->setAttribute('class', 'j-setting-content j-setting-global');
Expand Down Expand Up @@ -321,11 +320,6 @@ public static function needCache($path)
$pattern = '#^/action#i';
if (preg_match($pattern, $path)) return false;


//resource 缓存(这个页面是我自己加的...)
$pattern = '#^/resources#i';
if (preg_match($pattern, $path) and in_array('resources', self::$plugin_config->cache_page)) return true;

//fix:pjax search 失效
$requestUrl = self::$request->getRequestUri();
// search 请求第一次不缓存
Expand Down

0 comments on commit 1c54306

Please sign in to comment.