Skip to content

Instantly share code, notes, and snippets.

@osulyanov
Created July 24, 2013 03:55
Show Gist options
  • Save osulyanov/6067968 to your computer and use it in GitHub Desktop.
Save osulyanov/6067968 to your computer and use it in GitHub Desktop.
If-Modified-Since header check
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