How to optimize view rendering in Ruby on Rails 2.3.8?

I have a rails application that shows the following log for one action

Completed in 587ms (View: 415, DB: 29) | 200 OK [http://localhost/]

415 ms is required to view it. Is there a way to optimize the rendering of the view in rails? I'm new to ruby ​​on rails.

I am calling a call like this on a page (written in HAML) that showed me the specified registration time. I want to optimize the rendering of these partitions

  - auctions.each do |auction|
    = render :partial => "/shared/vertical_item", :object => auction,:inline => true  

thank

+3
source share
2 answers

A very good way to optimize your views is to use page fragmentation and caching. But be careful to overdo it.

0
source

, , :inline => true. :inline inline erb ,

  render :inline => "<%= 'hello ' + name %>", :locals => { :name => "david" }

( )

, :inline => true , .

, .

0

Source: https://habr.com/ru/post/1760702/


All Articles