在我的開發環境我有一個請求時產生數百個相同的查詢:爲什麼rails查詢緩存不起作用?
Person Load (24.4ms) SELECT "persons".* FROM "persons" WHERE ("persons"."person_id" = 517) LIMIT 1
. . .
Person Load (64.4ms) SELECT "persons".* FROM "persons" WHERE ("persons"."person_id" = 517) LIMIT 1
這是爲什麼?我認爲Rails應該在每個請求的基礎上默認啓用查詢緩存?
config/development.rb:
config.cache_classes = false
config.perform_caching = true
. . .
# Show full error reports and disable caching
config.consider_all_requests_local = true
config.action_view.debug_rjs = true
config.action_controller.perform_caching = true
config.active_support.deprecation = :log
查詢是否緩存在生產環境中? – 2010-12-01 18:40:38