Last active
June 22, 2018 10:44
-
-
Save PericlesTheo/ee3259c9210cdce43e567b266a9a39f1 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
@article = Article.find(params[:id]) | |
if stale?(etag: @article, last_modified: @article.created_at) | |
@statistics = @article.really_expensive_call | |
render json: @article | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment