diff --git a/src/core/fetch/ajax.js b/src/core/fetch/ajax.js index 1824cc459..d311f46b7 100644 --- a/src/core/fetch/ajax.js +++ b/src/core/fetch/ajax.js @@ -45,7 +45,8 @@ export function get (url, hasBar = false) { const result = cache[url] = { content: target.response, opt: { - updatedAt: xhr.getResponseHeader('last-modified') + updatedAt: xhr.getResponseHeader('last-modified') || + xhr.getResponseHeader('expires') } } diff --git a/src/core/render/index.js b/src/core/render/index.js index c4bd4201c..6c5581e4d 100644 --- a/src/core/render/index.js +++ b/src/core/render/index.js @@ -108,10 +108,12 @@ export function renderMixin (proto) { getAndActive('nav') } - proto._renderMain = function (text, opt) { + proto._renderMain = function (text, opt = {}) { callHook(this, 'beforeEach', text, result => { let html = this.isHTML ? result : markdown(result) - html = formatUpdated(html, opt.updatedAt, this.config.formatUpdated) + if (opt.updatedAt) { + html = formatUpdated(html, opt.updatedAt, this.config.formatUpdated) + } callHook(this, 'afterEach', html, text => renderMain.call(this, text)) })