开发者

Why rails give us two methods to config rails cache_store?

开发者 https://www.devze.com 2023-03-07 12:43 出处:网络
I found there are two methods to config cache_store: config.action_controller.cache_store = :mem_cache_store, \"localhost\"

I found there are two methods to config cache_store:

config.action_controller.cache_store = :mem_cache_store, "localhost"

here is doc

and:

config.cache_store = :mem_cache_store, "localhost"

It s开发者_运维问答eems that they are same thing.

Why rails give us two methods to config cache store? Is there any thing different?


Those values that you set in config.cache_store are used in config.action_controller.cache_store

The shorter version is simply easy to write out and remember. See the rails source that demonstrates this at: https://github.com/rails/rails/blob/v3.0.7/actionpack/lib/action_controller/caching.rb#L44

0

精彩评论

暂无评论...
验证码 换一张
取 消