Browse files

Update changelog for conditional GET utility methods

  • Loading branch information...
1 parent ba2d61d commit 08b0cf07dbc639c8609118eaeb34330d5168e8b2 @jeremy jeremy committed Aug 12, 2008
Showing with 8 additions and 2 deletions.
  1. +8 −2 actionpack/CHANGELOG
10 actionpack/CHANGELOG
@@ -7,8 +7,14 @@
* Update Prototype to #599 [Patrick Joyce]
* Conditional GET utility methods. [Jeremy Kemper]
- * etag!([:admin, post, current_user]) sets the ETag response header and returns head(:not_modified) if it matches the If-None-Match request header.
- * last_modified!(post.updated_at) sets Last-Modified and returns head(:not_modified) if it's no later than If-Modified-Since.
+ response.last_modified = @post.updated_at
+ response.etag = [:admin, @post, current_user]
+ if request.fresh?(response)
+ head :not_modified
+ else
+ # render ...
+ end
* All 2xx requests are considered successful [Josh Peek]

1 comment on commit 08b0cf0


Not sure if this is valid, but :

request.fresh? gives preference to last_modified, whereas special scoping to eg. user, session, params, RAILS_ASSET_ID etc. can be merged into the Etag identifier, but not possible with a Time instance …

On subsequent deploys, with RAILS_ASSET_ID being part of the etag, it’s silently ignored, and stale content served … as last_modified yields first.

The pattern used :

Please sign in to comment.