This repository contains code examples for various ways of using caching with Ruby on Rails.
The code is from talk I gave titled "Real World Caching". You can see the see the slides here.
Availible Demos:
- simple example of interacting with the Rails cache
- Fragment Caching
- Russian Doll Caching
- API example based on Model changes at http://localhost:3000/api/products.json
- API example based on changes for multiple Models at http://localhost:3000/api/products_and_posts_by_date.json
- Conditional GET example with clientside polling at http://localhost:3000/
bundle install
rake db:create && rake db:seed
foreman start
This requires Redis in development for caching.
On Mac OS, install with brew install redis
Run with foreman start
to start both redis-server
and rails server
.