V15: Add custom serializer for hybrid cache (#17727)

* Add custom serializer

* Add migration to rebuild cache

* Rename migration namespace to 15.1

* Also clear media cache

* Remove failed cache items

* Refactor to only use keys for document cache repository

---------

Co-authored-by: nikolajlauridsen <nikolajlauridsen@protonmail.ch>
This commit is contained in:
Nikolaj Geisle
2024-12-06 13:20:57 +01:00
committed by GitHub
parent ce6d4c34e2
commit 1c859e75ca
11 changed files with 123 additions and 102 deletions

View File

@@ -1,7 +1,6 @@

using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
using Umbraco.Cms.Core.Cache;
using Umbraco.Cms.Core.Configuration.Models;
using Umbraco.Cms.Core.DependencyInjection;
using Umbraco.Cms.Core.Notifications;
@@ -35,7 +34,7 @@ public static class UmbracoBuilderExtensions
// We'll be a bit friendlier and default this to a higher value, you quickly hit the 1MB limit with a few languages and especially blocks.
// This can be overwritten later if needed.
options.MaximumPayloadBytes = 1024 * 1024 * 100; // 100MB
});
}).AddSerializer<ContentCacheNode, HybridCacheSerializer>();
#pragma warning restore EXTEXP0018
builder.Services.AddSingleton<IDatabaseCacheRepository, DatabaseCacheRepository>();
builder.Services.AddSingleton<IPublishedContentCache, DocumentCache>();