gpt4 book ai didi

azure - 如何配置 Azure 缓存以使用自定义 IDataCacheObjectSerializer 类?

转载 作者:行者123 更新时间:2023-12-02 00:19:31 26 4
gpt4 key购买 nike

如何在 Web 角色中配置 Azure 缓存以使用自定义 IDataCacheObjectSerializer 类?如果您想知道为什么我想使用自定义序列化器:我想使用基于紧凑文本样式的 JSON(.net) 序列化与压缩相结合。在我的 .config 文件中,我可以启用压缩:

<dataCacheClient name="default" isCompressionEnabled="true"/>

但是如何/在哪里告诉 Azure 缓存(预览版)使用使用 JSON 序列化的自定义 IDataCacheObjectSerializer 类?

最佳答案

Jagan Peri 有一个 relevant blog post .

来自帖子:

<dataCacheClients>
<tracing sinkType="DiagnosticSink" traceLevel="Verbose" />

<!-- This is the default config which is used for all Named Caches
This can be overriden by specifying other dataCacheClient sections with name being the NamedCache name -->

<dataCacheClient name="default" useLegacyProtocol="false">
<autoDiscover isEnabled="true" identifier="WorkerRole1" />
<!--<localCache isEnabled="true" sync="TimeoutBased" objectCount="100000" ttlValue="300" />-->
<serializationProperties serializer="CustomSerializer" customSerializerType="Your.Fully.Qualified.Path.To.IDataCacheObjectSerializer,WorkerRole1" />
</dataCacheClient>
</dataCacheClients>

关于azure - 如何配置 Azure 缓存以使用自定义 IDataCacheObjectSerializer 类?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11569612/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com