How to Install Varnish Cache on Windows
Caching is not just a process of storing data in a temporary storage unit but also one of the pillars of web performance optimization. It’s a powerful technique to make your website load faster. The website can’t be called optimized without using a caching system.
In Magento 2, cleaning and flushing cache is essential after modifying configuration files, to apply the required changes. It collects configuration from all modules, merges it, and saves the merged result to the cache. This cache also contains store-specific settings stored in the file system and database.
By default, you can configure Magento 2 ‘Caching Application’ from Stores > Configuration > Advanced > System > Full Page Cache . You can see ‘Varnish Cache’ option with the recommended label.
You have to install varnish cache on windows to use its functionalities and configure it as this post shows you how to do it.
Let me first introduce “varnish” to you and how it’s different from the Magento default cache.
Varnish cache is a web application accelerator which stores files or fragments of files in memory to reduce the response time and network bandwidth consumption on future equivalent requests.
The varnish is a much quicker option and will give you the flexibility to cache most of your content, including HTML documents!
“Built-in “Full Page Cache” is enough for better performance”, and it’s the common misbelief while using Magento 2!
Individually, I recommend you to use built-in cache in development mode however when your store is in production mode, I strongly recommend using Varnish Cache for the optimal performance.
Steps to Install Varnish Cache on Windows
- Install Full Cygwin environment with varnish package
- Double click on setup-x86_64.exe and start the installation.
- Check the setup version and click on Next button.
- Choose the installation type. Here I want to install it from the internet.
- Select the root directory where you want to install it.
- Select local package directory from “Browse” button and click on the “Next” button.
- Select the site(s) from the list or add your site to the list by entering it in User URL textbox, and click “Add”.
- After progressing, the next dialogue box will display several packages and allow you to select packages to install.
- Search for ‘varnish’ in the Search filter of Select Packages popup, and then select the appropriate package and click “Next”.
- It will display the list of installation packages to review and confirm. Click on “Next” once reviewed.
- Click on “Next” after it completes 100% progress.
- After it finishes the installation, double click its icon that resides on the desktop.
You can see the command prompt by double-clicking this icon.
To check if varnish is installed or not, run the following command in the terminal.
It returns the version of Installed varnish.
Finally, the installation is done. You can configure varnish cache from Magento 2 store’s backend.
Quite lengthy but installed!
If you have any doubts, just mention them in the Comments section below.
I would be happy to help.
Feel free to share the solution with Magento 2 community via social media.