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
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 https://github.com/spf13/hugo/pull/3010
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鈥檛 need to be rerendered upon every invocation."
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.
Ah okay. Thanks for the clarification, then I've misunderstood and partially misused partialCached in my themes.
Most helpful comment
No, it is clearly a bug. The main moivation of
partialCachedis 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.