提交 6fae0a0e 编写于 作者: D David Heinemeier Hansson

No use case handy for justifying fresh? any more

上级 d85a7aec
*Edge*
* Added stale?/fresh? and fresh_when methods to provide a layer of abstraction above request.fresh? and friends [DHH]. Example:
* Added stale? and fresh_when methods to provide a layer of abstraction above request.fresh? and friends [DHH]. Example:
class ArticlesController < ApplicationController
def show_with_respond_to_block
......
......@@ -1096,11 +1096,6 @@ def stale?(options)
!request.fresh?(response)
end
# The opposite of stale? provided for parity when that feels more natural.
def fresh?(options)
!stale?(options)
end
# Sets the etag, last_modified, or both on the response and renders a
# "304 Not Modified" response if the request is already fresh.
#
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册