Skip to content
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

partialCache cache not flushed between reloads #3016

Closed
ghost opened this issue Feb 8, 2017 · 5 comments
Closed

partialCache cache not flushed between reloads #3016

ghost opened this issue Feb 8, 2017 · 5 comments
Assignees
Milestone

Comments

@ghost
Copy link

ghost commented Feb 8, 2017

Discussion started at: discuss.gohugo.io/t/no-cached-partials-with-server-command-or-watch-flag/

When using the 'server' command or the 'watch' flag, the cache of the partialCached template function does not get flushed.

Details
Hugo version: Hugo Static Site Generator v0.18.1 BuildDate: 2016-12-30T11:02:43+01:00
OS: Fedora 25 64-bit

@bep bep self-assigned this Feb 8, 2017
@bep bep added the Bug label Feb 8, 2017
@bep bep added this to the v0.19 milestone Feb 8, 2017
@bep
Copy link
Member

bep commented Feb 8, 2017

You may want to test the current master for this. I suspect it is fixed.

If not, I will check and close this as part of #3010

@Jos512
Copy link

Jos512 commented Feb 10, 2017

I like this feature/bug by the way, since a large part of my themes don't need to be rebuild with every website change (things like article count, random fetch of related articles, etcetera).

I believed that the partialCached not being flushed was a feature, since the documentation says that partialCached is not rendered every time. I read that as cached across different rebuilds too.

"(...) for complex templates that don’t need to be rerendered upon every invocation."

@bep
Copy link
Member

bep commented Feb 10, 2017

No, it is clearly a bug. The main moivation of partialCached is that if you, say, do some heavy computation in a partial, and that partial is used in 1000 pages, then that computation should only be done 1 time per build.

@Jos512
Copy link

Jos512 commented Feb 10, 2017

Ah okay. Thanks for the clarification, then I've misunderstood and partially misused partialCached in my themes.

bep added a commit to bep/hugo that referenced this issue Feb 17, 2017
This is a final rewrite that removes all the global state in Hugo, which also enables
the use if `t.Parallel` in tests.

Updates gohugoio#2701
Fixes gohugoio#3016
@bep bep closed this as completed in 93ca7c9 Feb 17, 2017
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants