{} end end # OR class HomeController < ApplicationController def index http_cache_forever(public: true) do render end end end # app/views/home/index.html.erb <h1>Welcome</h1> http_cache_forever
Processing by HomeController#index as HTML Rendered home/index.html.erb within layouts/ application (1.3ms) Completed 200 OK in 224ms (Views: 212.4ms | ActiveRecord: 0.0ms) # For consecutive requests for the same page Processing by HomeController#index as HTML Completed 304 Not Modified in 2ms (ActiveRecord: 0.0ms) http_cache_forever
@company.name %></h1> <p>You have successfully signed up to <%= @company.name %>, Your username is: <% end %> <%= @user.login %>. <br /> </p> <%= render :partial => 'footer' %> </body> ActionMailer Fragment Caching
we change city name from “Miami” to “Boston” then result might change. 2.No record is deleted. 3.No record is added. Caching result sets and collection