In attempting to get specific views max-age time values working, I discovered that Viewfield sets 'max-age' => 0 on every content type using a viewfield, no matter whether an actual view was rendered or not. This caused all content types using a Viewfield to become non-cacheable when relying on cacheable metadata.
Suggest removing the cache max-age entirely, as it appears that $view->buildRenderable($display_id, $arguments) is handling the cache settings on #content, or at least moving the max-age setting to be within the if (!empty($view->result) || $always_build_output) section to avoid having it set all of the time, even when there is no rendered view.
Comments
Comment #2
aveldina commentedPatch attached removes
'max-age' => 0,from $elements.Comment #3
keithm commentedComment #4
maxilein commentedGiven the possible impact on performance.
Comment #5
chris burge commentedComment #6
jerdavisThis was included in another patch/issue.
Comment #7
jerdavisComment #9
kopeboySo how was this solved? I can't find any documentation about a caching strategy, which is pretty important given the potential impact of this module. Do linked Views use the existing cache across hosting entities if they don't have active (host-specific) contextual filters?
Thank you
Comment #10
chris burge commented@kopeboy - Take a look at #2892073: Viewfields with same view but with different arguments render incorrect result..