From f871f33994e37806f038ed71cf610cbdd9e38756 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Wed, 27 Apr 2005 08:18:42 +0000 Subject: Added descriptions for new caching features git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1241 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/CHANGELOG | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) (limited to 'actionpack/CHANGELOG') diff --git a/actionpack/CHANGELOG b/actionpack/CHANGELOG index ae5750f6d5..3f7f3220b0 100644 --- a/actionpack/CHANGELOG +++ b/actionpack/CHANGELOG @@ -1,3 +1,49 @@ +*SVN* + +* Added BenchmarkHelper that can measure the execution time of a block in a template and reports the result to the log. Example: + + <% benchmark "Notes section" do %> + <%= expensive_notes_operation %> + <% end %> + + Will add something like "Notes section (0.345234)" to the log. + +* Added ActionController::Caching::Sweeper as an improved an easier to use sweeper. The new sweepers work on a single-step approach instead of two-steps like the old ones. Before + + def after_save(record) + @list = record.is_a?(List) ? record : record.list + end + + def filter(controller) + controller.expire_page(:controller => "lists", :action => %w( show public feed ), :id => @list.id) + controller.expire_action(:controller => "lists", :action => "all") + @list.shares.each { |share| controller.expire_page(:controller => "lists", :action => "show", :id => share.url_key) } + end + + ..after: + + def after_save(record) + list = record.is_a?(List) ? record : record.list + expire_page(:controller => "lists", :action => %w( show public feed ), :id => list.id) + expire_action(:controller => "lists", :action => "all") + list.shares.each { |share| expire_page(:controller => "lists", :action => "show", :id => share.url_key) } + end + + The new sweepers can also observe on the actions themselves by implementing methods according to (before|after)_$controller_$action. Example of a callback that'll be called after PagesController#update_title has been performed: + + def after_pages_update_title + expire_fragment(%r{pages/#{controller.assigns["page"].id}/.*}) + end + + Note that missing_method is delegated to the controller instance, which is assigned in a before filter. This means that you can call expire_fragment instead of @controller.expire_fragment. + +* Added that Fragments#expire_fragment now accepts as a regular expression as the name thereby deprecating expire_matched_fragments + +* Fixed that fragments shouldn't use the current host and the path as part of the key like pages does + +* Added conditions to around_filters just like before_filter and after_filter + + *1.8.1* (20th April, 2005) * Added xml_http_request/xhr method for simulating XMLHttpRequest in functional tests #1151 [Sam Stephenson]. Example: -- cgit v1.2.3