Sign in through GitHub
watch on iTunes
follow on Twitter
follow on Facebook
subscribe to RSS feed
Browse Episodes
RailsCasts Pro
About
Feedback
#1
Caching with Instance Variables
Mar 04, 2007 | 2 minutes |
Performance
,
Caching
Learn a quick way to improve performance. Just store the end result of an expensive command in an instance variable!
Click to Play Video ▶
Tweet
Download:
mp4
Full Size H.264 Video (3.6 MB)
m4v
Smaller H.264 Video (2.51 MB)
webm
Full Size VP8 Video (6.36 MB)
ogv
Full Size Theora Video (5.53 MB)
Show Notes
ASCIIcast
27 Comments
Similar Episodes
Next Episode >
application.rb
def current_user @current_user ||= User.find(session[:user_id]) end
def
current_user
@current_user
||=
User
.find(session[
:user_id
])
end