Skip to content

V15: Cache Seeding#17102

Merged
bergmania merged 234 commits intov15/devfrom
v15/feature/cache-seeding
Sep 24, 2024
Merged

V15: Cache Seeding#17102
bergmania merged 234 commits intov15/devfrom
v15/feature/cache-seeding

Conversation

@nikolajlauridsen
Copy link
Copy Markdown
Contributor

Implement cache seeding for Document and Media cache, enable seeded content to remain pinned, and fix various issues and todos.

Documents and media can both be seeded with a breadth-first search, there's been added new app settings for both to specify how many nodes should be seeded.

For documents, you can also seed a document type basis.

I found a couple of issues as well when working on this:

  • IIdKeyMap is used too much, for instance when deleting, I've fixed this by implementing GetContentSourceAsync with key instead of only id.
  • Found an issue in ToContentCacheNode where the templates were switched, so the published template was returned for unpublished content and vice versa.
  • Found a weird one, where because we cache published and draft separately RefreshContentAsync was called twice, once for the published, and once for draft, but RefreshContentAsync refreshed both regardless, I've added a check on IsDraft here

Testing

Test that the expected nodes are seeded, either by setting a breakpoint in the seed methods, or ideally by setting up a level two cache as specified in #16938, this will then allow you to look in the created DB table to see if the expected ids are cached.

It's also possible to set a breakpoint in GetContentSourceAsync in the DatabaseCacheRepository and ensure that this is not hit when resolving the seeded items.

nikolajlauridsen and others added 28 commits September 17, 2024 14:44
…v15/QA/hybrid-caching-tests

# Conflicts:
#	Directory.Packages.props
#	src/Umbraco.Core/Models/CacheSettings.cs
#	src/Umbraco.PublishedCache.HybridCache/DependencyInjection/UmbracoBuilderExtensions.cs
#	src/Umbraco.PublishedCache.HybridCache/NotificationHandlers/SeedingNotificationHandler.cs
#	src/Umbraco.PublishedCache.HybridCache/Persistence/DatabaseCacheRepository.cs
#	src/Umbraco.PublishedCache.HybridCache/Persistence/IDatabaseCacheRepository.cs
#	src/Umbraco.PublishedCache.HybridCache/Services/DocumentCacheService.cs
#	src/Umbraco.PublishedCache.HybridCache/Services/IDocumentCacheService.cs
#	tests/Umbraco.Tests.Common/Builders/ContentEditingBuilder.cs
#	tests/Umbraco.Tests.Integration/Testing/UmbracoIntegrationTestWithContentEditing.cs
#	tests/Umbraco.Tests.Integration/Umbraco.PublishedCache.HybridCache/DocumentHybridCacheDocumentTypeTests.cs
#	tests/Umbraco.Tests.Integration/Umbraco.PublishedCache.HybridCache/DocumentHybridCacheMockTests.cs
#	tests/Umbraco.Tests.Integration/Umbraco.PublishedCache.HybridCache/DocumentHybridCachePropertyTest.cs
#	tests/Umbraco.Tests.Integration/Umbraco.PublishedCache.HybridCache/DocumentHybridCacheScopeTests.cs
#	tests/Umbraco.Tests.Integration/Umbraco.PublishedCache.HybridCache/DocumentHybridCacheTests.cs
#	tests/Umbraco.Tests.Integration/Umbraco.PublishedCache.HybridCache/DocumentHybridCacheVariantsTests.cs
#	tests/Umbraco.Tests.Integration/Umbraco.PublishedCache.HybridCache/MediaHybridCacheTests.cs
#	tests/Umbraco.Tests.Integration/Umbraco.PublishedCache.HybridCache/MemberHybridCacheTests.cs
V15 QA hybrid caching integration tests
@bergmania bergmania merged commit e342e79 into v15/dev Sep 24, 2024
@bergmania bergmania deleted the v15/feature/cache-seeding branch September 24, 2024 07:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants