New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve fast render mode #5281

Closed
bep opened this Issue Oct 3, 2018 · 0 comments

Comments

Projects
None yet
1 participant
@bep
Member

bep commented Oct 3, 2018

In Hugo server's fast render mode (the default), we keep a stack of the recent browser history + the home pages. On rebuilds, we re-render only those. This works great, most of the time. But if you then navigate to a totally different page in the browser, you may see stale content until you do another edit.

To "render a page" in Hugo is normally very cheap, so can keep the fast render logic as it is today and when the user navigates to a new page in the browser:

  • We check if that page is already in the "visited stack"
  • If it's not, we render it and put it on the stack

The above trades away some potential double work (should be negligible) for a very simple and robust implementation.

@bep bep added the Enhancement label Oct 3, 2018

@bep bep added this to the v0.50 milestone Oct 3, 2018

@bep bep self-assigned this Oct 3, 2018

bep added a commit to bep/hugo that referenced this issue Oct 17, 2018

Prevent stale content in Fast Render Mode
We do that by re-render visited pages that is not already in the stack. This may potentially do some double work, but that small penalty should be well worth it.

Fixes gohugoio#5281

@bep bep closed this in #5329 Oct 17, 2018

bep added a commit that referenced this issue Oct 17, 2018

Prevent stale content in Fast Render Mode
We do that by re-render visited pages that is not already in the stack. This may potentially do some double work, but that small penalty should be well worth it.

Fixes #5281
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment