Adds a setting to cache textile rendering (off by default).

* it uses ActionController cache store which is MemoryStore by default and can be configured with config.action_controller.cache_store
* macro processing was moved out of textile rendering so that it doesn't get cached
* no noticeable improvement is expected for small portions of text, so only texts larger than 2KB are cached

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3372 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2010-02-06 10:40:21 +00:00
parent 6c8b87fbc8
commit 2ad8242ae7
44 changed files with 100 additions and 33 deletions
+3 -2
View File
@@ -396,13 +396,14 @@ module ApplicationHelper
text = args.shift
when 2
obj = args.shift
text = obj.send(args.shift).to_s
attr = args.shift
text = obj.send(attr).to_s
else
raise ArgumentError, 'invalid arguments to textilizable'
end
return '' if text.blank?
text = Redmine::WikiFormatting.to_html(Setting.text_formatting, text) { |macro, args| exec_macro(macro, obj, args) }
text = Redmine::WikiFormatting.to_html(Setting.text_formatting, text, :object => obj, :attribute => attr) { |macro, args| exec_macro(macro, obj, args) }
only_path = options.delete(:only_path) == false ? false : true
+2
View File
@@ -20,6 +20,8 @@
<p><%= setting_select :text_formatting, Redmine::WikiFormatting.format_names.collect{|name| [name, name.to_s]}, :blank => :label_none %></p>
<p><%= setting_check_box :cache_formatted_text %></p>
<p><%= setting_select :wiki_compression, [['Gzip', 'gzip']], :blank => :label_none %></p>
<p><%= setting_text_field :feeds_limit, :size => 6 %></p>