views:

601

answers:

1

Hello, I'm using rails 2.3 for a blog app. I'm trying to get caching to work. So far, I've managed to follow along with these tutorials: http://railslab.newrelic.com/2009/01/22/page-caching

I thought everything was working fine. I even managed to get a cachesweeper to work a la the next tutorial in that series.

But I noticed in the development log, it says the page is being cached:

Cached page: /articles.html (0.8ms)

But when i refresh the page, development log still shows requests being made to the server. And this only happens with the index page. Requests for the show pages render the cached html. No activity in the development log. Not sure what is happening. Any help would be appreciated.

A: 

When you do a cache, the page is generated as an html in the respective folder. And when you do a request to the server, mongrel (web server) does capture the request made and churn it into the log, however, you'll noticed that the action, which in this case i would suppose is articles, will not be called, but the cached html page, articles.html will be rendered instead, bypassing any logic you may have.

You can refer to http://railscasts.com/episodes/89-page-caching for more details =)

Staelen