服务器的内存缓存可以在 Azure 中使用吗?
Can the server's in-memory cache be used in Azure?
我需要我的 Web API 有缓存来存储一些数据。我一直在研究 Azure 上的缓存,我看到微软推荐使用 Redis 缓存。
我可以使用普通服务器的内存缓存来存储只能通过 Web 访问的简单数据吗?API 或者 Redis 是我唯一的选择。
Azure 上的服务器内存有任何限制吗?
当然可以。 Azure Redis 缓存不是唯一的选择。可以考虑使用Microsoft.Extensions.Caching.Memory
like MemoryCache
to store your simple data, and make sure the size of your data is less than the available tails memory size on Azure App Service which be restricted by the memory limit of Azure App Services for different tiers, as the figure below from App Service limits
.
同时,即使你可以考虑使用支持更多内存的带有HTTP触发器的Azure Functions来实现你的Web API,请参考Functions limits
。
希望对您有所帮助。
我需要我的 Web API 有缓存来存储一些数据。我一直在研究 Azure 上的缓存,我看到微软推荐使用 Redis 缓存。
我可以使用普通服务器的内存缓存来存储只能通过 Web 访问的简单数据吗?API 或者 Redis 是我唯一的选择。 Azure 上的服务器内存有任何限制吗?
当然可以。 Azure Redis 缓存不是唯一的选择。可以考虑使用Microsoft.Extensions.Caching.Memory
like MemoryCache
to store your simple data, and make sure the size of your data is less than the available tails memory size on Azure App Service which be restricted by the memory limit of Azure App Services for different tiers, as the figure below from App Service limits
.
同时,即使你可以考虑使用支持更多内存的带有HTTP触发器的Azure Functions来实现你的Web API,请参考Functions limits
。
希望对您有所帮助。