Class: ActionController::Caching::Actions::ActionCacheFilter
- Inherits:
-
Object
- Object
- ActionController::Caching::Actions::ActionCacheFilter
- Defined in:
- lib/easy_esi.rb
Overview
replace cached includes cache miss:
filter_with_esi -> filter_without_esi -> after_filter -> filter_with_esi
do not replace <include> in after filter, but after filter_without_esi
cache hit:
filter_with_esi -> filter_without_esi -> filter_with_esi
after_filter will not be called, but <include> needs to be replaced
Instance Method Summary collapse
Instance Method Details
#filter_with_esi(controller, &block) ⇒ Object
50 51 52 53 54 55 56 57 58 |
# File 'lib/easy_esi.rb', line 50 def filter_with_esi(controller, &block) controller.instance_variable_set "@do_not_replace_esi", true result = filter_without_esi(controller, &block) controller.instance_variable_set "@do_not_replace_esi", false controller.send(:render_esi) if controller.esi_enabled result end |