Skip to content

Commit 27bde31

Browse files
Merge pull request #1 from nikolajlauridsen/v15/add-maximumpayload-bytes-settings
V15: Add maximumpayload bytes settings
2 parents a4f6dc8 + 9c74b23 commit 27bde31

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
@@ -10,6 +10,34 @@ Are you looking for the **NuCache Settings**?
1010
While most cache configurations are under the `Umbraco:CMS:Cache` settings node, a few remain under `Umbraco:CMS:NuCache`. [Learn more about this at the bottom of this article](#nucache-settings).
1111
{% endhint %}
1212

13+
## HybridCacheOptions
14+
15+
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).
16+
17+
### MaximumPayLoadBytes
18+
19+
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.
20+
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.
21+
To try and avoid this Umbraco overrides this setting to 100MB by default, however you can also configure this manually using a composer:
22+
23+
```csharp
24+
using Microsoft.Extensions.Caching.Hybrid;
25+
using Umbraco.Cms.Core.Composing;
26+
27+
namespace MySite.Caching;
28+
29+
public class ConfigureCacheComposer : IComposer
30+
{
31+
public void Compose(IUmbracoBuilder builder)
32+
{
33+
builder.Services.AddOptions<HybridCacheOptions>().Configure(x =>
34+
{
35+
x.MaximumPayloadBytes = 1024 * 1024 * 10; // 10MB
36+
});
37+
}
38+
}
39+
```
40+
1341
## Seeding settings
1442

1543
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)