Created
April 1, 2013 20:25
-
-
Save supertopher/5287467 to your computer and use it in GitHub Desktop.
Quick look at really basic cache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PostsController < ApplicationController | |
caches_page :index, :show | |
def index | |
#if nothing happens that should affect the cache leave it alone | |
end | |
def edit | |
#in any class that has potentional to change cache | |
expire_page action: [:index, :show] | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment