Why does Rails report a cache miss?

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?

Answers


The first cache miss seems to be a page-cache check.

The second one is the fragment-cache check which is fine.


Need Your Help

SQL Query does not fetch the required data in iphone application

ios iphone sql sqlite join

I am getting data from sqlite table using join in iphone application it fetches the data fine but it does not get the data accurate here is my query

How to change HTTP header for a specific content type?

java internet-explorer ssl richfaces flash

I'm using RichFaces and I'm having problems with the fileUpload flash component + IE + SSL. According to research I've done, I need to change "Pragma" and "Cache-Control" HTTP headers.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.