Skip to content

Commit dcf8a9c

Browse files
Add HybridCacheOptions section
1 parent 047d41a commit dcf8a9c

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

15/umbraco-cms/reference/configuration/cache-settings.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,34 @@ description: Information on the Cache settings section
44

55
# Cache settings
66

7+
## HybridCacheOptions
8+
9+
Umbraco's cache is implemented using Microsofts `HybridCache`, which also has its own settings. For more information [see the HybridCache documentation](https://learn.microsoft.com/en-us/aspnet/core/performance/caching/hybrid?view=aspnetcore-9.0#options).
10+
11+
### MaximumPayLoadBytes
12+
13+
One `HybridCache` setting of particular interest is the `MaximumPayloadBytes` setting. This setting specifies the maximum size of a cache entry in bytes, and replaces the `BTreeBlockSize` setting from NuCache.
14+
The default from Microsoft is 1MB. However, this limit could quickly be reached, especially if using property editors like the block grid, and multiple languages.
15+
To try and avoid this Umbraco overrides this setting to 100MB by default, however you can also configure this manually using a composer:
16+
17+
```csharp
18+
using Microsoft.Extensions.Caching.Hybrid;
19+
using Umbraco.Cms.Core.Composing;
20+
21+
namespace MySite.Caching;
22+
23+
public class ConfigureCacheComposer : IComposer
24+
{
25+
public void Compose(IUmbracoBuilder builder)
26+
{
27+
builder.Services.AddOptions<HybridCacheOptions>().Configure(x =>
28+
{
29+
x.MaximumPayloadBytes = 1024 * 1024 * 10; // 10MB
30+
});
31+
}
32+
}
33+
```
34+
735
## Seeding settings
836

937
The Seeding settings allow you to specify which content should be seeded into your cache. For more information on cache seeding see the [Cache Seeding.](../cache/cache-seeding.md) article.

0 commit comments

Comments
 (0)