Skip to content

feat(cache): option for cache rendered content#3963

Merged
SukkaW merged 1 commit into
hexojs:masterfrom
SukkaW:server-development
Dec 16, 2019
Merged

feat(cache): option for cache rendered content#3963
SukkaW merged 1 commit into
hexojs:masterfrom
SukkaW:server-development

Conversation

@SukkaW

@SukkaW SukkaW commented Dec 14, 2019

Copy link
Copy Markdown
Member

What does it do?

In #3756, @dailyrandomphoto disabled cache rendered content for generate and enabled for hexo s.

Enabling cache rendered content for hexo s will respond more quickly from second requests which is helpful when use hexo-server in production, but it also makes more difficult when developing theme or previewing other changes. So the config.server.cache is introduced in this PR. The documents for hexo-server will be updated after this PR is merged and released with hexo@4.3.

How to test

git clone -b server-development https://github.com/sukkaw/hexo.git
cd hexo
npm install
npm test

Screenshots

Pull request tasks

  • Add test cases for the changes.
  • Passed the CI test.

@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.0008%) to 97.14% when pulling a4719b4 on SukkaW:server-development into 2c50d3b on hexojs:master.

1 similar comment
@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.0008%) to 97.14% when pulling a4719b4 on SukkaW:server-development into 2c50d3b on hexojs:master.

@curbengh

Copy link
Copy Markdown
Contributor

Enabling cache rendered content for hexo s will respond more quickly from second requests which is helpful when use hexo-server in production, but it also makes more difficult when developing theme or previewing other changes.

This PR disable it by default though, shouldn't it be enabled for most users?

@SukkaW

SukkaW commented Dec 15, 2019

Copy link
Copy Markdown
Member Author

@curbengh

Most users and theme developers are using hexo-server as a live preview. Only few of them are using hexo-server to serve their website.

@curbengh curbengh changed the title refactor(cache): option for cache rendered content feat(cache): option for cache rendered content Dec 16, 2019
@curbengh

Copy link
Copy Markdown
Contributor

Possibly supersedes hexojs/hexo-server#76

@SukkaW SukkaW merged commit 499c2b6 into hexojs:master Dec 16, 2019
@SukkaW SukkaW mentioned this pull request Dec 21, 2019
1 task
SukkaW added a commit to hexojs/hexo-server that referenced this pull request Dec 21, 2019
SukkaW added a commit to hexojs/hexo-server that referenced this pull request Dec 23, 2019
* docs(README): add description about cache

The feature is introduced in hexojs/hexo#3963

* docs(README): update cache description
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants