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 · 4 comments

Comments

Projects
None yet
2 participants
@ghost

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

This comment has been minimized.

Show comment
Hide comment
@bep

bep Feb 8, 2017

Member

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

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

This comment has been minimized.

Show comment
Hide comment
@Jos512

Jos512 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."

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

This comment has been minimized.

Show comment
Hide comment
@bep

bep Feb 10, 2017

Member

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.

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

This comment has been minimized.

Show comment
Hide comment
@Jos512

Jos512 Feb 10, 2017

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

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

all: Refactor to nonglobal Viper, i18n etc.
This is a final rewrite that removes all the global state in Hugo, which also enables
the use if `t.Parallel` in tests.

Updates #2701
Fixes #3016

@bep bep closed this in 93ca7c9 Feb 17, 2017

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