Some people work with Varnish as a reverse proxy, but if it doesn’t connect properly or you no longer use it, you should remove it.
All programs should be uninstalled if they are not being used after installation to reduce the occurrence of problems. So I would like to organize the process of completely uninstalling Varnish Cache Server.
※ All operations may affect the system, so please perform a backup before performing the operation.
Table of Contents
What is Varnish?
Varnish Cache is a web accelerator and HTTP cache server that caches dynamic content to reduce web server load and improve page loading speed.
ESI (Edge Side Includes) technology can be used to efficiently provide dynamic content. ESI can reduce server load by caching only the parts that change less, without caching the entire page.
Stop Varnish service
sudo systemctl stop varnish
First, you need to stop the service that is currently running. You can do this by opening an SSH terminal and entering the command above.
Remove Varnish
sudo apt remove --purge varnish
A command to remove an installed package. It removes both the package and its configuration files using the apt package manager.
Delete remaining files and directories
sudo rm -rf /etc/varnish
sudo rm -rf /var/lib/varnish
Enter the two commands above to remove both files and directories.
Remove dependent packages
sudo apt autoremove
A command to clean up unnecessary dependency packages installed with Varnish.
Reboot the system
sudo reboot
If you have removed everything with the commands described above, you can reboot your system. Rebooting your system may cause the site to close for a while.
In most cases, there will be leftover files or settings after the operation, which can cause problems, so it is recommended to restore a backup or delete the installation files as described above.
▶ How to install dual WordPress on CyberPanel
▶ LightSail CDN: Recapping How to Set Up LiteSpeed Cache
▶ How to resolve .user.ini warnings in NinjaFireWall plugins