Make IPropertyCacheCompressionOptions useful out of the box. key = "Umbraco.Web.PublishedCache.NuCache.CompressUnPublishedContent" value = "true" will compress all ntext properties on unpublished content
This commit is contained in:
@@ -26,8 +26,16 @@ namespace Umbraco.Web.PublishedCache.NuCache
|
||||
{
|
||||
composition.RegisterUnique<IContentCacheDataSerializerFactory, MsgPackContentNestedDataSerializerFactory>();
|
||||
}
|
||||
|
||||
composition.RegisterUnique<IPropertyCacheCompressionOptions, NoopPropertyCacheCompressionOptions>();
|
||||
var unPublishedContentCompression = ConfigurationManager.AppSettings[NuCacheSerializerComponent.Nucache_UnPublishedContentCompression_Key];
|
||||
if ("MsgPack" == serializer && "true" == unPublishedContentCompression)
|
||||
{
|
||||
composition.RegisterUnique<IPropertyCacheCompressionOptions, UnPublishedContentPropertyCacheCompressionOptions>();
|
||||
}
|
||||
else
|
||||
{
|
||||
composition.RegisterUnique<IPropertyCacheCompressionOptions, NoopPropertyCacheCompressionOptions>();
|
||||
}
|
||||
|
||||
|
||||
composition.RegisterUnique(factory => new ContentDataSerializer(new DictionaryOfPropertyDataSerializer()));
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@ namespace Umbraco.Web.PublishedCache.NuCache
|
||||
public class NuCacheSerializerComponent : IComponent
|
||||
{
|
||||
internal const string Nucache_Serializer_Key = "Umbraco.Web.PublishedCache.NuCache.Serializer";
|
||||
internal const string Nucache_UnPublishedContentCompression_Key = "Umbraco.Web.PublishedCache.NuCache.CompressUnPublishedContent";
|
||||
private const string JSON_SERIALIZER_VALUE = "JSON";
|
||||
private readonly Lazy<IPublishedSnapshotService> _service;
|
||||
private readonly IKeyValueService _keyValueService;
|
||||
|
||||
Reference in New Issue
Block a user