Information on the Cache settings section
Umbraco's cache is implemented using Microsofts HybridCache
, which also has its own settings. For more information see the HybridCache documentation .
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. The default from Microsoft is 1MB. However, this limit could quickly be reached, especially when using multiple languages or property editors like the block grid. To avoid this Umbraco overrides the setting to 100MB by default. You can also configure this manually using a composer:
using Microsoft.Extensions.Caching.Hybrid;
using Umbraco.Cms.Core.Composing;
namespace MySite.Caching;
public class ConfigureCacheComposer : IComposer
{
public void Compose(IUmbracoBuilder builder)
{
builder.Services.AddOptions<HybridCacheOptions>().Configure(x =>
{
x.MaximumPayloadBytes = 1024 * 1024 * 10; // 10MB
});
}
}
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. article.
The ContentTypeKeys
setting specifies which Document Types should be seeded into the cache. The setting is a comma-separated list of Document Type keys.
"Umbraco": {
"CMS": {
"Cache": {
"ContentTypeKeys": ["e811405e-0190-4d3e-8387-7558521eec81", "419e89fb-8cff-4549-a074-9f8a30687828", "e0d71146-8205-4cf4-8236-f982b392259f"],
}
}
}
DocumentBreadthFirstSeedCount
The DocumentBreadthFirstSeedCount
setting specifies how many documents should be seeded into the cache when doing a breadth-first traversal. The default value is 100.
"Umbraco": {
"CMS": {
"Cache": {
"DocumentBreadthFirstSeedCount": 500
}
}
}
MediaBreadthFirstSeedCount
The MediaBreadthFirstSeedCount
setting specifies how many media items should be seeded into the cache when doing a breadth-first traversal. The default value is 100.
"Umbraco": {
"CMS": {
"Cache": {
"MediaBreadthFirstSeedCount": 500
}
}
}
The Entry settings allow you to specify how long cache entries should be kept. The cache entry settings are identical for documents and media.
Specifies the duration for which cache entries should be kept in the local memory cache. The default value is 24 hours.
"Umbraco": {
"CMS": {
"Cache": {
"Entry": {
"Document": {
"LocalCacheDuration": "2.00:00:00"
},
"Media": {
"LocalCacheDuration": "50.00:00:00"
}
}
}
}
}
Specifies the duration that cache entries should be kept in the remote cache, second level cache. This setting is only relevant if a second-level cache is configured. The default value is 1 year.
"Umbraco": {
"CMS": {
"Cache": {
"Entry": {
"Document": {
"RemoteCacheDuration": "100.00:00:00"
},
"Media": {
"RemoteCacheDuration": "150.00:00:00"
}
}
}
}
}
Specifies the duration for which seeded cache entries should be kept in the cache. The default value is 1 year.
"Umbraco": {
"CMS": {
"Cache": {
"Entry": {
"Document": {
"SeedCacheDuration": "200.00:00:00"
},
"Media": {
"SeedCacheDuration": "250.00:00:00"
}
}
}
}
}
For backward compatibility reasons, certain settings are under the Umbraco:CMS:NuCache
settings node.
When UsePagedSqlQuery
is set to False
, the Fetch
method is used instead of the QueryPaged
method for rebuilding the NuCache files. This will increase performance on larger Umbraco websites with a lot of content when rebuilding the NuCache.
"Umbraco": {
"CMS": {
"NuCache": {
"UsePagedSqlQuery": false
}
}
}
Specifying the SqlPageSize
will change the size of the paged SQL queries. The default value is 1000.
"Umbraco": {
"CMS": {
"NuCache": {
"SqlPageSize": 500
}
}
}
The NuCacheSerializerType
setting allows developers to specify the serialization format for cached content.
The fastest and most compact format MessagePack
is used by default.
An alternate JSON
option was provided for backward compatibility for the Umbraco cache implementation used from Umbraco 8 to 14 (NuCache).
It is no longer supported with the cache implementation from Umbraco 15+ based on .NET's Hybrid cache.
The option is kept available only for a more readable format suitable for testing purposes.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4