11. Action Caching
Works the same as way as page caching ...
but goes through dispatcher to run filters and
callbacks
For example you can use it with pages that
require authentication
14. Fragment Caching
More flexible
Great for dynamic content directed at specific
users or conditions (ex: your friends latest blog
posts)
Transforms portions of your views into rendered
HTML
23. DB Model Cache
It’s built into Rails, you don’t have to do
nothing
good for not making the same query twice
limited... only works on the same request
29. example with data
View (first time)
View (second time, it’s read from the cache)
30. More info on caching
http://www.railsenvy.com/2007/2/28/rails-caching-
tutorial
http://railscasts.com/episodes/115
http://www.thewebfellas.com/blog/2008/6/9/rails-2-1-
now-with-better-integrated-caching
http://www.akitaonrails.com/2008/5/25/rolling-with-
rails-2-1-the-first-full-tutorial-part-1
46. Other Small Tips
Use LibXML-Ruby for processing XML:
http://libxml.rubyforge.org/
Log only what you need
Use a CDN (ex: Amazon CloudFront)
Patch the RUBY GC:
http://rubyforge.org/projects/railsbench/
47. That’s it!
Have fun!
Don’t be afraid to
experiment!
Tweak until your
satisfied!
If all fails, invest in
hardware. :)