Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Update changelog for conditional GET utility methods

  • Loading branch information...
commit 08b0cf07dbc639c8609118eaeb34330d5168e8b2 1 parent ba2d61d
@jeremy jeremy authored
Showing with 8 additions and 2 deletions.
  1. +8 −2 actionpack/CHANGELOG
View
10 actionpack/CHANGELOG
@@ -7,8 +7,14 @@
* Update Prototype to 1.6.0.2 #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

@methodmissing

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 : http://gist.github.com/5459

Please sign in to comment.
Something went wrong with that request. Please try again.