For a shopper to view a single page of your ecommerce website, that shopper’s web browser needs to receive lots of files from the server(s) that are hosting your site. These web files range from kilobytes up to several megabytes in size and can be in the JPG, HTML, JS, CSS and Video formats. Historically, the server would need to locate and transmit all of the relevant frontend files that make up a single webpage. That occurred every time a page in your site was viewed by a shopper. In essence, each page of the site was retrieved, assembled, compiled, compressed, and transmitted each time a new shopper visited the site.
Various caching technologies have been introduced over the years in order to improve that process. Varnish® is one of the fastest and most successful of these systems. This technology keeps a precompiled copy of the cached web page in RAM, which is the fastest type of memory in a modern computer system. By keeping this cache, the server does not have to retrieve and re-process the website code. Instead, it’s processed once and then simply forwarded to every next web visitor. This is often compared to having food ready and in a “warmer” at a fast food restaurant, so customers can get what they want as quickly as possible. This creates a more frictionless user experience.
So, why isn’t every Magento 2 site properly leveraging Varnish? Well, like many pieces of advanced technology, configuration and maintenance can be an issue. It can be especially dizzying to manage Varnish outside of Magento, forcing developers to log in to a Varnish server and pivot between the Magento 2 Admin and Varnish.
Luckily, there is now a solution! The hosting experts at JetRails built a Varnish extension for Magento 2. This extension includes many helpful features and functionalities:
– Support for multiple Varnish servers
– Purge all cache in Varnish (based on URL path OR store view)
– Automatically purge cache when product, category, and CMS pages are altered
– Create exclusion rules based on URL paths, routes, modules, controllers, and actions
– Verbose HTTP response headers can be enabled for debugging
Best of all, this extension is being made available to all M2 Open Source and M2 Commerce users that are hosted by JetRails.
The benefits of using Varnish for your Magento website
According to Google, 53% of mobile site visits are abandoned if pages take longer than 3 seconds to load. As part of an overall loading speed optimization strategy, Varnish can lead to better conversion rates, more successful marketing campaigns, and overall revenue growth.
Varnish also helps to conserve hosting resources. Without a strong caching system, your site can waste a lot of server power to piece together web pages that could already be cached. This can leave you paying for more CPUs, RAM, and servers than you need. It can also leave your hosting resources more easily overtaxed when you experience traffic spikes.
Magento 2 Varnish Extension Installation and Configuration
Installation is quick and easy, just as it should be for any properly built Magento 2 extension:
You can read up on the full installation and configuration at: https://learn.jetrails.com/article/magento-2-varnish-extension#installation-process
Once installed, connecting the extension with your Varnish servers is simple and straightforward:
And so is using the extension for functions like purging the Varnish Cache™:
Click here for instructions on how to download and set up our Magento 2 Varnish extension.
Looking for more ways to optimize your Magento site?
Interested in other extensions to improve your Magento hosting and security? Then be sure to check out our Magento 1 & 2 Cloudflare extension and our Magento 1 two-factor authentication extension.
Have other Magento hosting questions or concerns? We’re here to help! Please be in touch with the JetRails Magento hosting experts to learn more about secure, fast, scalable, and reliable Magento hosting.
Varnish is a registered trademark of Varnish Software AB and its affiliates.