Last Updated: May 15, 2019
·
1.001K
· elia

Faster browser rendering

To improve the browser rendering time add width and height attributes to your <img> tags. This way the browser doesn't have to wait for the image download to know its dimensions and can start immediately to layout the page.

Reference: https://developers.google.com/speed/docs/best-practices/rendering#SpecifyImageDimensions

If you're on Rails you can use the dimensions-rails gem that adds those dimensions for you!

Just put it in your Gemfile and enjoy!