簡體   English   中英

如何配置identity_cache gem以使用dalli存儲?

[英]How to configure identity_cache gem to use dalli store?

找不到用於配置identity_cachedalli一起使用的文檔。 有人可以告訴我這是怎么做的嗎?

我在config/environments/development.rb中嘗試過此操作(我想先在開發環境中嘗試此操作):

config.identity_cache_store = :mem_cache_store, ActiveSupport::Cache::DalliStore.new(servers: ["mem"])

當我啟動rails時,我看到了這個錯誤:

uninitialized constant ActiveSupport::Cache::DalliStore (NameError)

設置達利寶石

然后使用以下命令創建您的身份緩存存儲:

Dalli::Client.new

...因此您的development.rb文件將具有:

config.action_controller.perform_caching = true
config.cache_store = :dalli_store
config.identity_cache_store = :dalli_store, Dalli::Client.new(:servers => ["mem1.server.com"])

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM