Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Rails Caching Basics
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
David Moulton
November 13, 2012
Programming
110
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Rails Caching Basics
Delivered at the 11/2012 UV.rb
David Moulton
November 13, 2012
More Decks by David Moulton
See All by David Moulton
OpenWest Ionic Presentation
dmoulton
2
83
Faye URUG Presentation
dmoulton
1
94
Other Decks in Programming
See All in Programming
The ROI of Quarkus for Spring Boot Applications
hollycummins
0
150
TAKTでAI駆動開発の品質を設計する
j5ik2o
7
1.6k
AIキャラアプリkaiwaの低遅延音声通話基盤をどう作ったか - AWS Gravitonで支える低遅延・低コストAI Agent基盤
mogamit
0
140
AIで効率化できた業務・日常
ochtum
0
150
エンジニアと一緒にテストコードの設計と実装を改善した話
mototakatsu
0
230
AI駆動開発を妨げる技術的負債の解消アプローチ / ai-refactoring-approach
minodriven
15
8k
Agentic UI
manfredsteyer
PRO
0
210
Javaの型とAI時代に型が大事な理由 / java types and type in AI era
kishida
2
160
「AIで開発し、AIを届ける」をEvalでつなぐ 〜AIネイティブに始めるプロダクト開発の実践〜 / Connecting "Develop with AI, deliver AI" with Eval
rkaga
4
5.5k
dRuby over BLE
makicamel
2
400
生成AI時代にこそ効くGo | Why Go Works in the Age of Generative AI
mom0tomo
8
3.4k
Language Server 使ってる? 〜VSCode と Zed の場合〜 / Are you using a Language Server? ~For VS Code and Zed~
handlename
0
810
Featured
See All Featured
Building Flexible Design Systems
yeseniaperezcruz
330
40k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
55k
Designing Powerful Visuals for Engaging Learning
tmiket
1
430
How to build a perfect <img>
jonoalderson
1
5.7k
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
630
Designing for Performance
lara
611
70k
Deep Space Network (abreviated)
tonyrice
0
220
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.7k
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.2k
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
160
For a Future-Friendly Web
brad_frost
183
10k
エンジニアに許された特別な時間の終わり
watany
107
250k
Transcript
Rails Caching Basics
Setup To test caching in dev mode, edit development. rb:
config.action_controller.perform_caching = true Normally this should be false
Page Caching class UsersController < ActionController caches_page :index def index
@users = User.all end ... def create ... expire_page :action => :index end end
Action Caching Can be used when you need to be
authorized to view a page but want to cache it as well.
Fragment Caching cache part of a page <% cache(:action =>
'index', :action_suffix => 'all_users')do %> @users.each do |u| ... <% end %>
Sweepers More centralized location for taking care of cache invalidation
Cache Stores Config config.cache_store = :memory_store config.cache_store = :memory_store, :size
=> 64.megabytes config.cache_store = :file_store, "path/to/cachedir" config.cache_store = :memcache_store, "cache.example.com"