Reputation: 1653
I have enabled action caching for some actions in my app. When I run in production mode (caching enabled, using memory cache) I get the following output on the first request:
cache: [GET /users/user72] miss
Started GET "/users/user72" for 127.0.0.1 at 2012-09-09 20:46:10 +0100
Processing by UsersController#show as HTML
Parameters: {"username"=>"user72", "user"=>{"username"=>"user72"}}
Read fragment views/localhost:4000/users/user72 (0.0ms)
Write fragment views/localhost:4000/users/user72 (0.0ms)
Rendered text template within layouts/application (0.0ms)
Completed 200 OK in 87ms (Views: 0.2ms | ActiveRecord: 9.7ms)
All good. Then on the second request:
cache: [GET /users/user72] miss
Started GET "/users/user72" for 127.0.0.1 at 2012-09-09 20:46:11 +0100
Processing by UsersController#show as HTML
Parameters: {"username"=>"user72", "user"=>{"username"=>"user72"}}
Read fragment views/localhost:4000/users/user72 (0.0ms)
Rendered text template within layouts/application (0.0ms)
Completed 200 OK in 5ms
It looks like the second request was served from the cache as I'd expect, but seems to be reported as a cache miss. Anyone know why? Am I wrong and it really is a cache miss? Or is Rails telling lies?
Upvotes: 0
Views: 882
Reputation: 115541
The first cache miss seems to be a page-cache check.
The second one is the fragment-cache check which is fine.
Upvotes: 1