Varnish as an Easy Way to Boost Pagespeed with Incredible Results

The other day, during a daily stand-up, we were discussing how to improve our main website speed. Most of the solutions proposed were related to caching at the software level. My proposal was a bit different, as in the past, when working on Magento infrastructure, I discovered Varnish.
Varnish is a cache software that can be implemented as a reverse proxy. All requests are received first by Varnish, and then, based on its configuration file, the response can be cached or allowed to hit the server behind. The first time Varnish starts, when receiving a request, it validates that there is no cached copy of it. If there is no cached content, it will consider it a miss and will pass the request to the server behind. If the file or content is allowed to be cached, it will save the content in memory, and the next time the same request hits your server, it will return the content immediately.
What makes Varnish different? Usually, when requesting a file from your website, the server will have to check on disk for the file and then return it to the user. Varnish, instead, receives the request and immediately returns it from memory. Accessing RAM is less taxing than accessing the disk.
In the beginning, we were only caching JS, CSS, and image files. This is because there were some endpoints that provided up-to-date information, and it is easy to bypass these in the configuration files. The problem was there were so many, and we didn’t want to take the risk at that moment. Even though we only cached files, the website loading time reduced by over 1 second.
These were the tests before implementing Varnish:
This is the average page speed after the implementation.
Get quality content updates subscribing to the newsletter, Zero Spam!