Skip to main content
All CollectionsNitroPack for Magento
How to Configure Varnish with NitroPack for Optimal Magento Performance
How to Configure Varnish with NitroPack for Optimal Magento Performance
Updated over 10 months ago

If your Magento store uses the Varnish, you need to take additional steps to integrate it with NitroPack. By configuring this setup, NitroPack will synchronize both cache layers, optimizing your website's performance to the fullest extent.


Before you start

Make sure your Magento store has:


Configuring NitroPack with Varnish

Step 1: Update your Full Page Caching settings in Magento Admin

  1. Log in to the admin section of your Magento website.

  2. Navigate to Stores > Configuration > Advanced > System.

  3. Expand the 'Full Page Cache' section.

  4. Choose NitroPack' in the 'Caching Application' dropdown.

  5. Expand the 'Enable Varnish field and select “Yes.”

  6. Input your Varnish’s IP address and port in the Reverse Proxy IP (<ip>:<port>) e.g., 127.0.0.1:443

Step 2: Clean up the cache

Flush your Magento cache using the following commands:

php bin/magento cache:clean
php bin/magento cache:flush

Step 3: Verify that it works

Navigate to Magento Admin > NitroPack to review your NitroPack settings and confirm that your pages are in the process of being optimized.

Follow the steps provided in this article, load your website, and check the response headers for the following:

  • X-Nitro-Cache should have the value HIT (indicating NitroPack’s status)

  • X-Magento-Debug should have the value HIT (indicating Varnish status)

Please make sure that both response headers are present and verify the proper configuration of your Magento website with Varnish and NitroPack.

Note: If you are unable to get the HTTP response header X-Magento-Debug, comment the line in a file (/etc/varnish/default.vcl)

# unset resp.http.X-Magento-Debug;

📌 If you need any assistance or have questions, contact our support team at [email protected] or via the chat bubble at the bottom right corner.

Did this answer your question?