Rack-ESI is a Nokogiri based ESI middleware implementation for Rack with support for include tags, all other ESI namespaced nodes are just removed. To make this gem work you must define the (xmlns:esi)[http://www.edge-delivery.org/esi/1.0] namespace in your text/html response. Note: This gem should only be used in development. For production use setup varnish or any other ESI enabled server.
Gemfile gem 'rack-esi', '~> 0.2.0'
install gem install rack-esi