Skip to content

Caching: Don't remove null values from hybrid cache to avoid broken content references repeatedly requiring a database hit (closes #18892)#20209

Merged
AndyButland merged 3 commits intomainfrom
v16/handle-caching-of-null-values
Sep 22, 2025
Merged

Caching: Don't remove null values from hybrid cache to avoid broken content references repeatedly requiring a database hit (closes #18892)#20209
AndyButland merged 3 commits intomainfrom
v16/handle-caching-of-null-values

Conversation

@Zeegaan
Copy link
Copy Markdown
Member

@Zeegaan Zeegaan commented Sep 21, 2025

Fixes #18892

Notes

  • Thanks to some investigate work from @enkelmedia, fetching deleted nodes from for example a MultiNodeTree picker, will try to fetch the deleted content, resulting in a Database hit.
  • This PR remedies that, by also caching null values.
  • A little background on the decision not to cache null values, was that we had no way of deleting nodes with keys that we did not know. Now we can delete all content by tags, so we have a way of removing them again 😁

How to test

  • Make content picker datatype which can choose multiple content
  • Make a content type using that datatype
  • Create 2 different documents, 1 referencing the other, save and publish, then delete the referenced content.
  • In your template for the existing content, try getting the value of the multi node picker with @Model.Value("propertytype name here")
  • This should no longer result in a database hit (atleast after the first get), as we will cache the null value

Copilot AI review requested due to automatic review settings September 21, 2025 18:54

This comment was marked as outdated.

Copy link
Copy Markdown
Contributor

@AndyButland AndyButland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have followed the provided test steps and confirm this resolves the issue. Thanks @Zeegaan.

@AndyButland AndyButland changed the title Caching: Cache published value of unpublished content as null to make Descendants etc. faster. #18892 Caching: Don't remove null values from hybrid cache to avoid broken content references repeatedly requiring a database hit (closes #18892) Sep 22, 2025
@AndyButland AndyButland merged commit e29e612 into main Sep 22, 2025
25 checks passed
@AndyButland AndyButland deleted the v16/handle-caching-of-null-values branch September 22, 2025 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Performance: Degradation in throughput v13 vs 15

3 participants