In this KB:
- What is Turpentine?
- How to install Turpentine
- How to configure Turpentine
Turpentine is a full page cache extension to improve Magento’s compatibility with Varnish, a fast caching reverse-proxy. By default, Varnish does not cache requests with cookies and Magento sends the frontend cookie with every request causing a (near) zero hit-rate for Varnish’s cache. Turpentine provides Varnish configuration files (VCLs) to work with Magento and modifies Magento’s behavior to significantly enhance the cache hit rate.
Step 1: Login to Magento Admin Panel
Login to your Magento admin panel and navigate to “System” > “Magento Connect” and click on Magento Connect Manager.
Step 2: Login to Magento Connect Manager
Now, login to Magento Connect Manager using your Magento admin credentials.
After you logged in, click on “Magento Connect” to search for modules.
Step 3: Install Turpentine-Varnish Cache
Search for Turpentine in the search window and then click on Turpentine – Varnish cache.
Now, click on Install Now
It will display “You must be registered and logged in to get extension key”.If you are already registered then enter your login credentials by clicking on logged in and click again on “Install Now” button.
You will see messages like below “Accept Licence agreement”. Check mark on it to accept licence agreement and then click on Get Extension Key.
Copy the complete Extension key and go back to the Magento connect manager page. Paste the Key in “Paste extension key to install“and then click on Install.
In Extension dependencies, click on Proceed button.
A window will appear and you can check your installation process here.
Step 4: Configuring Turpentine-Varnish Cache
Once the installation is completed, return to your Magento admin by clicking on “Return to Admin” at the top of the window and then navigate to “System” > “Configuration”. You will find “Varnish Options” inside TURPENTINE at the left of the screen.
Under Varnish Options, use the following parameters inside General Options and then click on Save Config.
Similarly, use the below parameters under “Servers” and insert your own Varnish Authentication Key with the \n appended at the end, and then click on Save config. (*If you don’t varnish auth. key, please contact our LiveChat support staff).
Now, click on Caching Options under Varnish Option and use the settings inside “Backend” as below.
Then, go to the Normalization Options and set the settings as below and leave the other options blank.
- Normalize Encoding = Enable
- Normalize User-Agent = Disable
- Normalize Host = Disable
Go to the TTls section and use below settings.
- Set Grace Period (seconds) = 15
- Set Default Page TTL (seconds) = 3600
- Set Static File TTL (seconds) = 28800
Now, set the URL-based Caching, Parameter-based Caching, Static Caching and Maintenance Mode fields as shown below.
Now click on “Save Config” option at the top to the save the settings. That’s it, your Magento Caching setting has been completed.
And, in order to work varnish with secure (SSL) connection, navigate to System > Configuration > Web > Secure and set the value “SSL_OFFLOADED” under the Offloder header field, and then click on the “Save Config” button.
To verify whether Varnish is working or not, clear cache both from Magento Admin as well as from SSH, and then check your website with developers tool enabled. You should see the ‘x-cache: HIT’ under the headers field.