The recommended way to speed up erb rendering is to not do this. Try using page caching or conditional GET headers to avoid replaying content that hasn't changed.
http://guides.rubyonrails.org/caching_with_rails.html
class ProductsController < ApplicationController def show @product = Product.find(params[:id])
source share