Previously we mentioned Wroclove.rb conference in our article with the list of Ruby conferences to visit in 2018. This conference was held on March 16-18 in Wrocław, Poland, and there are many great insights from Wroclove.rb we want to share with you. For example, 13 simple ways to improve web performance with Rails. These tips will greatly simplify your work!
Based on a talk ‘Web Performance with Rails’ by Stefan Wintermeyer, from Wroclove.rb, these tools and tricks will result in better Rails and general web performance. These ways are pretty simple and obvious, but many developers don’t know them, have forgotten about them, or they simply don’t care. All the tips are divided into two parts: Rails-related and general web performance tips
13 simple ways to improve web performance with Rails
- View: Fragment caching
- Database: Counter cache
- HTTP: etag and last_modified
- Controller + server: Page caching
- Uploads and images: ActiveStorage
- Use HTTP/2
- CDN with HTTP/2 are not so useful
- Prefer Brotli over Gzip
- Heroku vs Bare Metal (with Heroku you can get a basic setup for your app running in minutes, but it’s not the best fit in the context of web performance)
- Resource Hints: dns-prefetch
- Resource Hints: prefetch
- Resource Hints: prerender
- Resource Hints: preconnect
The other additional tips include HTTP/2 PUSH that allows a web server to send resources to a web browser before the browser gets to request them. This can be a performance technique that helps some websites load twice faster.
Summarized from Radek Markiewicz material.