Created
July 24, 2013 03:55
-
-
Save osulyanov/6067968 to your computer and use it in GitHub Desktop.
If-Modified-Since header check
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
def show | |
@show = Show.find(params[:id]) | |
if stale?(:etag => @show, :last_modified => @show.updated_at.utc) | |
respond_to do |format| | |
format.html # index.html.erb | |
format.json { render json: @show } | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment