Cache-ing Rails apps

Rails have a lot of neat features as you most likely already well know. One thing that could improve in my view is cache-ing. In ColdFusion for example you can cache things and tell it how long you would like it to be cached before expiring. In Rails, you need to set a cron job that would delete files if you want to achieve similar effect. Which is far from great.

Here is simple example, let’s say I have site like this blog and for some reason million of people daily hit it. I can be very productive and post updates every few minutes. So instead of hitting database every moment with millions of queries, I would cache pages and let them expire every minute. Result is that you get updates as you would with direct access and DB get’s just several hits per minute.

Anyway, Tobias Luetke have article on how to set something similar in Rails here. I really like his approach and it solves a lot of hardship with cacheing.

Advertisements

~ by Zeljko Dakic on May 22, 2007.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: