diff --git a/lib/hexo/default_config.js b/lib/hexo/default_config.js index 6ece1225fa..daaf6b4a89 100644 --- a/lib/hexo/default_config.js +++ b/lib/hexo/default_config.js @@ -62,6 +62,9 @@ module.exports = { pagination_dir: 'page', // Extensions theme: 'landscape', + server: { + cache: false + }, // Deployment deploy: {}, diff --git a/lib/hexo/index.js b/lib/hexo/index.js index b1b57aae92..3f41b79b0d 100644 --- a/lib/hexo/index.js +++ b/lib/hexo/index.js @@ -311,7 +311,11 @@ class Hexo { watch(callback) { let useCache = false; - if (this.env.cmd.startsWith('s')) { + const { cache } = Object.assign({ + cache: false + }, this.config.server); + + if (this.env.cmd.startsWith('s') && cache) { // enable cache when run hexo server useCache = true; }