I’m not too sure about that, but I guess that depends (if you’re processing images, it is a big win to cache also on Netlify). Hugo detects if you’re running on Netlify and sets the cache dir (if not set by you) to a Netlify path that survives builds.
There are several options:
set cacheDir to something else (either as a flag or via a separate dev/prod config, see the section about config dirs in the docs )
OK, so I should set the directory to the default during build. Which would be this $TMPDIR/hugo_cache ?
Via a flag seems straight forward (hugo --cacheDir $TMPDIR/hugo_cache/), but the docs suggested to me the config option would be that in my original post. Would it be this instead then?
[caches]
[caches.getjson]
dir = "/Users/me/my/path/cache"
[build]
[caches]
[caches.getjson]
dir = "$TMPDIR/hugo_cache/"