Wip support for compressing/decompressing nucache documents on a per property basis. Option for compressing the properties in sql/nucache.db. Option for immediate/lazy decompression of properties. Mapping support for shorter property alias.
TODO: config file for property map TODO: HasValue and IsValue on propertyvalueconverterbase
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
using System.Configuration;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
using System.Linq;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Composing;
|
||||
using Umbraco.Web.PublishedCache.NuCache.DataSource;
|
||||
@@ -15,11 +17,26 @@ namespace Umbraco.Web.PublishedCache.NuCache
|
||||
|
||||
if (serializer == "MsgPack")
|
||||
{
|
||||
composition.Register<IContentNestedDataSerializer, MsgPackContentNestedDataSerializer>();
|
||||
var propertyDictionarySerializer = ConfigurationManager.AppSettings["Umbraco.Web.PublishedCache.NuCache.DictionaryOfPropertiesSerializer"];
|
||||
if (propertyDictionarySerializer == "LZ4Map")
|
||||
{
|
||||
composition.Register<INucachePropertyOptionsFactory, AppSettingsNucachePropertyMapFactory>();
|
||||
composition.Register(factory =>
|
||||
{
|
||||
var lz4Serializer = factory.GetInstance<Lz4DictionaryOfPropertyDataSerializer>();
|
||||
return new ContentDataSerializer(lz4Serializer);
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
composition.Register(factory => new ContentDataSerializer(new DictionaryOfPropertyDataSerializer()));
|
||||
}
|
||||
composition.Register<IContentNestedDataSerializer, MsgPackContentNestedDataSerializer>();
|
||||
}
|
||||
else
|
||||
{
|
||||
composition.Register<IContentNestedDataSerializer, JsonContentNestedDataSerializer>();
|
||||
composition.Register(factory => new ContentDataSerializer(new DictionaryOfPropertyDataSerializer()));
|
||||
}
|
||||
|
||||
// register the NuCache database data source
|
||||
@@ -34,5 +51,6 @@ namespace Umbraco.Web.PublishedCache.NuCache
|
||||
// TODO: no NuCache health check yet
|
||||
//composition.HealthChecks().Add<NuCacheIntegrityHealthCheck>();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user