Caching foor starters

Hi there…

I have some experience in building web applications but all of them
have been intranet apps so I have never had to think about things like
caching. Actually my experience with caching has more been in the area
of removing it since it just gets in the way for a intranet app with
10-100 users.

But now I am writing a site which might stand or fall by the quality
of it’s caching. But I don’t find to much info on how the built in
caching is in Rails or if I should get myself a plugin or if I have to
code it myself. The site is nothing overly dynamic. I’ts basically a
list of sites and each has ratings and comments. (You can basically
see the basics at

Could anyone give me a link or pointers on a good method of caching.
Apart from the commenting I think this could be cached to hell.

From the sounds of it you could use Page Caching. This is the fastest
method of caching rails has to offer. It creates static html filles of
each of your actions in public directory. This way the web server can
load these static pages without having to start rails. It doesn’t get
any faster than that! To expire these cached pages, you will probably
want to implement a sweeper. The rails wiki has good info on both of
these. To expire these pages, you can expire a single page at a time
with the rails expire_page method. I wrote a plugin that will allow you
to expire an entire action, or controller with an expire_each_page
method. I’ve got some more info and a short tutorial at my blog

My Page caching tutorial
My Broomstick plugin(page expiring helper)

Charlie B.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs