diff --git a/src/core/render/compiler.js b/src/core/render/compiler.js
index fbc3f083c..78250f257 100644
--- a/src/core/render/compiler.js
+++ b/src/core/render/compiler.js
@@ -106,8 +106,9 @@ export function sidebar (text, level) {
html = markdown(text)
html = html.match(/
]*>([\s\S]+)<\/ul>/g)[0]
} else {
- const tree = genTree(toc, level)
+ const tree = cacheTree[currentPath] || genTree(toc, level)
html = treeTpl(tree, '')
+ cacheTree[currentPath] = tree
}
return html
diff --git a/src/core/render/index.js b/src/core/render/index.js
index d6b689336..de7a6fa28 100644
--- a/src/core/render/index.js
+++ b/src/core/render/index.js
@@ -75,7 +75,7 @@ export function renderMixin (proto) {
this._renderTo('.sidebar-nav', sidebar(text, maxLevel))
const active = getAndActive('.sidebar-nav', true, true)
- loadSidebar && subSidebar(active, subMaxLevel)
+ subSidebar(loadSidebar ? active : '', subMaxLevel)
// bind event
this.activeLink = active
scrollActiveSidebar()