Design and implement a caching strategy

Created on 17 May 2017, almost 8 years ago
Updated 16 September 2023, over 1 year ago

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.

🐛 Bug report
Status

Fixed

Version

3.0

Component

Code

Created by

🇨🇦Canada aveldina

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024