Created
February 25, 2009 22:31
-
-
Save Gregg/70478 to your computer and use it in GitHub Desktop.
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
# To set max-age | |
expires_in 10.minutes | |
# To set the etag | |
if stale?(:etag => @user) | |
# or | |
fresh_when(:etag => @user) | |
# You can also send in multiple models | |
if stale?(:etag => [@user, @post]) | |
# To set last_modified | |
if stale?(:last_modified => @user.updated_at.utc) | |
# or | |
fresh_when :last_modified => @user.updated_at.utc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment