Skip to content

Commit

Permalink
Update changelog for conditional GET utility methods
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremy committed Aug 13, 2008
1 parent ba2d61d commit 08b0cf0
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions actionpack/CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down

1 comment on commit 08b0cf0

@methodmissing
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.