开发者

Why rails give us two methods to config rails cache_store?

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜