diff --git a/10/umbraco-cms/reference/configuration/nucachesettings.md b/10/umbraco-cms/reference/configuration/nucachesettings.md index 8ba88edc72b..5066aac31a0 100644 --- a/10/umbraco-cms/reference/configuration/nucachesettings.md +++ b/10/umbraco-cms/reference/configuration/nucachesettings.md @@ -4,7 +4,9 @@ description: "Information on the NuCache settings section" # NuCache Settings -This settings section allows you to specify the block size of the BTree used by NuCache. This is configured by default, so you don't need to configure this. However it is possible with something like: +The NuCache settings allow you to configure different aspects of how cached content is stored and retrieved. Below are the details of the available settings and how they can be configured to optimize performance and compatibility with your project needs. + +## BTreeBlockSize ```json "Umbraco": { @@ -16,15 +18,42 @@ This settings section allows you to specify the block size of the BTree used by } ``` -This is how NuCache is configured by default. It is important to mention that the block size must be a power of two, at least 512, and at most 65536 (64K). +{% hint style="info" %} +The block size must be a power of two. It should be at least 512 and at most 65536 (64K). +{% endhint %} -## Additional Settings +## NuCacheSerializerType + +The `NuCacheSerializerType` setting allows developers to specify the serialization format for NuCache content. This setting is particularly relevant for projects migrating from older versions of Umbraco that relied on JSON formats. + +To use JSON serialization instead of the default MessagePack: + +### Using 'Program.cs' + +```csharp +builder.Services.Configure(options => +{ + options.NuCacheSerializerType = NuCacheSerializerType.JSON; +}); +``` -It is possible to configure NuCache to work in memory only without reading/writing the NuCache database files. +### Using 'appsettings.json' -Startup duration may increase for larger sites during a "warm boot" but smaller sites should see minimal impact. +```csharp +{ + "Umbraco": { + "CMS": { + "NuCache": { + "NuCacheSerializerType": "JSON" + } + } + } +} +``` + +## Additional Settings -The settings have not yet been exposed via the new configuration setup, instead you must configure with a composer. +You can configure NuCache to work in memory only without reading/writing to the NuCache database files. Startup duration may increase for larger sites during a "warm boot" but smaller sites should see minimal impact. The settings have not yet been exposed via the new configuration setup, instead you must configure with a composer. ```csharp public class DisableNuCacheDatabaseComposer : IComposer diff --git a/13/umbraco-cms/reference/configuration/nucachesettings.md b/13/umbraco-cms/reference/configuration/nucachesettings.md index 378a1be0596..cca6666b9ca 100644 --- a/13/umbraco-cms/reference/configuration/nucachesettings.md +++ b/13/umbraco-cms/reference/configuration/nucachesettings.md @@ -4,7 +4,9 @@ description: Information on the NuCache settings section # NuCache Settings -This settings section allows you to specify the block size of the BTree used by NuCache. This is configured by default, so you don't need to configure this. However it is possible with something like: +The NuCache settings allow you to configure different aspects of how cached content is stored and retrieved. Below are the details of the available settings and how they can be configured to optimize performance and compatibility with your project needs. + +## BTreeBlockSize ```json "Umbraco": { @@ -16,11 +18,13 @@ This settings section allows you to specify the block size of the BTree used by } ``` -This is how NuCache is configured by default. It is important to mention that the block size must be a power of two, at least 512, and at most 65536 (64K). +{% hint style="info" %} +The block size must be a power of two. It should be at least 512 and at most 65536 (64K). +{% endhint %} ## UsePagedSqlQuery -Setting `UsePagedSqlQuery` to `False` your project will use the `Fetch` method instead of the `QueryPaged` method when rebuilding the NuCache files. This will increase performance on bigger Umbraco websites with a lot of content when rebuilding the NuCache. +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. ```json "Umbraco": { @@ -33,13 +37,38 @@ Setting `UsePagedSqlQuery` to `False` your project will use the `Fetch` method ``` -## Additional Settings +## NuCacheSerializerType + +The `NuCacheSerializerType` setting allows developers to specify the serialization format for NuCache content. This setting is particularly relevant for projects migrating from older versions of Umbraco that relied on JSON formats. + +To use JSON serialization instead of the default MessagePack: + +### Using 'Program.cs' + +```csharp +builder.Services.Configure(options => +{ + options.NuCacheSerializerType = NuCacheSerializerType.JSON; +}); +``` -It is possible to configure NuCache to work in memory only without reading/writing the NuCache database files. +### Using 'appsettings.json' -Startup duration may increase for larger sites during a "warm boot" but smaller sites should see minimal impact. +```csharp +{ + "Umbraco": { + "CMS": { + "NuCache": { + "NuCacheSerializerType": "JSON" + } + } + } +} +``` + +## Additional Settings -The settings have not yet been exposed via the new configuration setup, instead you must configure with a composer. +You can configure NuCache to work in memory only without reading/writing to the NuCache database files. Startup duration may increase for larger sites during a "warm boot" but smaller sites should see minimal impact. The settings have not yet been exposed via the new configuration setup, instead you must configure with a composer. ```csharp public class DisableNuCacheDatabaseComposer : IComposer diff --git a/14/umbraco-cms/reference/configuration/nucachesettings.md b/14/umbraco-cms/reference/configuration/nucachesettings.md index 378a1be0596..cca6666b9ca 100644 --- a/14/umbraco-cms/reference/configuration/nucachesettings.md +++ b/14/umbraco-cms/reference/configuration/nucachesettings.md @@ -4,7 +4,9 @@ description: Information on the NuCache settings section # NuCache Settings -This settings section allows you to specify the block size of the BTree used by NuCache. This is configured by default, so you don't need to configure this. However it is possible with something like: +The NuCache settings allow you to configure different aspects of how cached content is stored and retrieved. Below are the details of the available settings and how they can be configured to optimize performance and compatibility with your project needs. + +## BTreeBlockSize ```json "Umbraco": { @@ -16,11 +18,13 @@ This settings section allows you to specify the block size of the BTree used by } ``` -This is how NuCache is configured by default. It is important to mention that the block size must be a power of two, at least 512, and at most 65536 (64K). +{% hint style="info" %} +The block size must be a power of two. It should be at least 512 and at most 65536 (64K). +{% endhint %} ## UsePagedSqlQuery -Setting `UsePagedSqlQuery` to `False` your project will use the `Fetch` method instead of the `QueryPaged` method when rebuilding the NuCache files. This will increase performance on bigger Umbraco websites with a lot of content when rebuilding the NuCache. +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. ```json "Umbraco": { @@ -33,13 +37,38 @@ Setting `UsePagedSqlQuery` to `False` your project will use the `Fetch` method ``` -## Additional Settings +## NuCacheSerializerType + +The `NuCacheSerializerType` setting allows developers to specify the serialization format for NuCache content. This setting is particularly relevant for projects migrating from older versions of Umbraco that relied on JSON formats. + +To use JSON serialization instead of the default MessagePack: + +### Using 'Program.cs' + +```csharp +builder.Services.Configure(options => +{ + options.NuCacheSerializerType = NuCacheSerializerType.JSON; +}); +``` -It is possible to configure NuCache to work in memory only without reading/writing the NuCache database files. +### Using 'appsettings.json' -Startup duration may increase for larger sites during a "warm boot" but smaller sites should see minimal impact. +```csharp +{ + "Umbraco": { + "CMS": { + "NuCache": { + "NuCacheSerializerType": "JSON" + } + } + } +} +``` + +## Additional Settings -The settings have not yet been exposed via the new configuration setup, instead you must configure with a composer. +You can configure NuCache to work in memory only without reading/writing to the NuCache database files. Startup duration may increase for larger sites during a "warm boot" but smaller sites should see minimal impact. The settings have not yet been exposed via the new configuration setup, instead you must configure with a composer. ```csharp public class DisableNuCacheDatabaseComposer : IComposer diff --git a/15/umbraco-cms/reference/configuration/cache-settings.md b/15/umbraco-cms/reference/configuration/cache-settings.md index ff396b51374..ac31431bb44 100644 --- a/15/umbraco-cms/reference/configuration/cache-settings.md +++ b/15/umbraco-cms/reference/configuration/cache-settings.md @@ -151,13 +151,13 @@ Specifies the duration for which seeded cache entries should be kept in the cach } ``` -# NuCache Settings +## NuCache Settings For backward compatibility reasons, certain settings are under the `Umbraco:CMS:NuCache` settings node. -## UsePagedSqlQuery +### UsePagedSqlQuery -Setting `UsePagedSqlQuery` to `False` your project will use the `Fetch` method instead of the `QueryPaged` method when rebuilding the NuCache files. This will increase performance on bigger Umbraco websites with a lot of content when rebuilding the NuCache. +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. ```json "Umbraco": { @@ -169,7 +169,8 @@ Setting `UsePagedSqlQuery` to `False` your project will use the `Fetch` method i } ``` -## SqlPageSize + +### SqlPageSize Specifying the `SqlPageSize` will change the size of the paged SQL queries. The default value is 1000. @@ -182,3 +183,32 @@ Specifying the `SqlPageSize` will change the size of the paged SQL queries. The } } ``` + +## NuCacheSerializerType + +The `NuCacheSerializerType` setting allows developers to specify the serialization format for NuCache content. This setting is particularly relevant for projects migrating from older versions of Umbraco that relied on JSON formats. + +To use JSON serialization instead of the default MessagePack: + +### Using 'Program.cs' + +```csharp +builder.Services.Configure(options => +{ + options.NuCacheSerializerType = NuCacheSerializerType.JSON; +}); +``` + +### Using 'appsettings.json' + +```csharp +{ + "Umbraco": { + "CMS": { + "NuCache": { + "NuCacheSerializerType": "JSON" + } + } + } +} +```