Skip to content

Update cache handling

  1. Use entity bundle cache tags and update minimum Drupal version to 8.9. As far as I can tell this also means we can remove the prevnext-ENTITY_TYPE-BUNDLE cache tag.
  2. Use the route rather than url cache context.
  3. Ensure the entity view cache is cleared when the module config's updated, regardless of whether it's currently enabled for the entity type.
  4. Ensure the user.permissions cache context is always added if links are enabled for the entity type. It's not likely to make a difference because of the default cache contexts but I think it's strictly speaking a little more correct.
  5. Ensure cacheability metadata is added even if the link doesn't generate correctly.
  6. Remove the ENTITY_TYPE_view cache tag: IIUC it's for content that's built with the entity view builder. If eg. a block with links is cached, it doesn't need to be purged every time the entity view display's saved.
  7. Track the URL cacheability metadata.
  8. Avoid adding a cache tag to every entity view: Rather than adding the prevnext config cache tag to every entity view regardless of whether it's enabled, we respond to the config being updated and explicitly purge the relevant entity view cache tags. This causes less cache churn when prevnext settings are updated and also fewer cache tags being stored.

Closes #3417653

Edited by Andy Fowlston

Merge request reports

Loading