Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V15: Cache Seeding #17102

Merged
merged 234 commits into from
Sep 24, 2024
Merged

V15: Cache Seeding #17102

merged 234 commits into from
Sep 24, 2024

Conversation

nikolajlauridsen
Copy link
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
4 of 8 checks passed
@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