January 2009
1 post
7 tags
Expire eTAGs when you redeploy
Rails 2.2’s eTAG functionality is great. def show @article = Article.find(params[:id]) if stale_record(@article) # do something expensive end end protected def stale_record?(record) fresh_when(:etag => [current_user, record], :last_modified => record.updated_at.utc) !request.fresh?(response) end “304 NOT MODIFIED” all around! But this determines...
Jan 19th