PHPackages                             taurus-media/magento2-varnish-extended - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Caching](/categories/caching)
4. /
5. taurus-media/magento2-varnish-extended

ActiveMagento2-module[Caching](/categories/caching)

taurus-media/magento2-varnish-extended
======================================

This extension extends the built-in Varnish functionalities

1.0.0(2mo ago)055OSL-3.0PHPPHP ^8.3

Since Feb 15Pushed 2mo agoCompare

[ Source](https://github.com/taurus-media/magento2-varnish-extended)[ Packagist](https://packagist.org/packages/taurus-media/magento2-varnish-extended)[ RSS](/packages/taurus-media-magento2-varnish-extended/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (2)Used By (0)

[![VCL Tests](https://github.com/elgentos/magento2-varnish-extended/actions/workflows/vcl_tests.yml/badge.svg)](https://github.com/elgentos/magento2-varnish-extended/actions/workflows/vcl_tests.yml)

Elgentos\_VarnishExtended
=========================

[](#elgentos_varnishextended)

This module aims to add some extra features to the Varnish capabilities in Magento.

Configurable tracking parameters
--------------------------------

[](#configurable-tracking-parameters)

The [core Magento VCL](https://github.com/magento/magento2/blob/2.4-develop/app/code/Magento/PageCache/etc/varnish6.vcl) contains hard-coded marketing tracking parameters. Almost nobody changes them, but adding tracking parameters often used on your site highly increases hit rate.

This extension adds a field under Stores &gt; Config &gt; System &gt; Full Page Cache &gt; Varnish Configuration &gt; Tracking Parameters in the backend to customize your own parameters.

**IMPORTANT NOTE**: this is not applied automatically! You need to use the optimized VCL:

```
bin/magento varnish:vcl:generate --export-version=6 --input-file=vendor/elgentos/magento2-varnish-extended/etc/varnish6.vcl --output-file=/data/web/varnish6.vcl
varnishadm vcl.load new-custom-vcl /data/web/varnish6.vcl
varnishadm vcl.use new-custom-vcl

```

Marketing Parameters
--------------------

[](#marketing-parameters)

### Info message when removing marketing parameters

[](#info-message-when-removing-marketing-parameters)

Marketing parameters in the URL have a negative effect on the hit rate of the (Varnish) cache. You can list the marketing parameters that Varnish should remove to improve the hit rate.

Don't worry, removing these parameters will not break Magento, because these URL parameters are only processed in your browser, not on the server.

### Warning message when a marketing parameter matches our regular expression

[](#warning-message-when-a-marketing-parameter-matches-our-regular-expression)

**Warning:** you are trying to remove a marketing parameter from the URL that is also a *filterable product attribute* in Magento. Are you sure you want to remove it? Removing this parameter may prevent Magento from filtering on that attribute.

Checking the Varnish hit rate
-----------------------------

[](#checking-the-varnish-hit-rate)

If you use RUMVision and when on Hypernode or Maxcluster, you can view the historical Varnish hit rate in RUMvision.

Otherwise you can do it manually:

```
wget --quiet https://raw.githubusercontent.com/olivierHa/check_varnish/master/check_varnish.py
chmod +x check_varnish.py
./check_varnish.py -f MAIN.cache_hit,MAIN.cache_miss -r

```

A good hit-rate for a B2C store is around 80-90%. For B2B, this would be lower, depending on how closed-off your catalog is.

Auto-apply custom VCL
---------------------

[](#auto-apply-custom-vcl)

You can place it in your Git repo in `app/etc/varnish6.vcl` and automate applying it through [Deployer](https://deployer.org/) on each deploy with the following Deployer task.

```
desc('Auto-apply VCL when custom VCL exists');
task('vcl:auto-apply', function () {
    if (test('[ -f {{release_path}}/app/etc/varnish6.vcl ]')) {
        $timestamp = date('YmdHis');
        run('{{bin/php}} {{release_path}}/bin/magento varnish:vcl:generate --export-version=6 --input-file={{release_path}}/app/etc/varnish6.vcl --output-file=/data/web/varnish6.vcl');
        run('varnishadm vcl.load vcl' . $timestamp . ' /data/web/varnish6.vcl');
        run('varnishadm vcl.use vcl' . $timestamp);
    }
})->select('stage=production');

```

Contrary to popular belief, loading &amp; activating ('using') a new VCL does not purge the cache objects already in Varnish. However, the new VCL might change how future requests are processed, which could result in cached items being evicted sooner or fetched differently.

Compatibility
-------------

[](#compatibility)

Needs at least Magento 2.4.7 and Varnish 6.4.

If you run into your VCL being generated without curly braces inside `for` and `if` directives, please check if you haven't still applied patch MDVA-4344. If you're running a recent Magento version, this patch isn't needed and breaks generation of the VCL.

Running the test suite
----------------------

[](#running-the-test-suite)

The features of the VCL template are covered by a range of automated tests. To run the test suite, simply run `make test` in the `tests/varnish` folder:

```
cd tests/varnish
make test
```

The `make test` command will start a Docker container that has all the `.vtc` files mounted and runs the `varnishtest` command to run the tests.

This is the equivalent of running the following command in the `tests/varnish` folder:

```
varnishtest *.vtc
```

This will run the entire test suite, but you can also run individual tests by running the following command:

```
cd tests/varnish
make test_single TEST=purge.vtc
```

This will only run the tests inside the `purge.vtc` file, which is the equivalent of running `varnishtest purge.vtc`.

More information about the `varnishtest` program can be found on the [varnish-cache.org documentation site](https://varnish-cache.org/docs/trunk/reference/varnishtest.html). You will also find information on the [Varnish Test Case syntax](https://varnish-cache.org/docs/trunk/reference/vtc.html).

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance83

Actively maintained with recent releases

Popularity12

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

86d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9a63921d7d7fd387db50f9e01c25123205ad89de7a50c0c95ea2ba4061cc4b26?d=identicon)[taurus-media](/maintainers/taurus-media)

---

Top Contributors

[![peterjaap](https://avatars.githubusercontent.com/u/431360?v=4)](https://github.com/peterjaap "peterjaap (78 commits)")[![ThijsFeryn](https://avatars.githubusercontent.com/u/603546?v=4)](https://github.com/ThijsFeryn "ThijsFeryn (58 commits)")[![toonvd](https://avatars.githubusercontent.com/u/1227745?v=4)](https://github.com/toonvd "toonvd (55 commits)")[![JeroenBoersma](https://avatars.githubusercontent.com/u/1163348?v=4)](https://github.com/JeroenBoersma "JeroenBoersma (10 commits)")[![dverkade](https://avatars.githubusercontent.com/u/1058480?v=4)](https://github.com/dverkade "dverkade (10 commits)")[![hostep](https://avatars.githubusercontent.com/u/85479?v=4)](https://github.com/hostep "hostep (10 commits)")[![tdgroot](https://avatars.githubusercontent.com/u/1165302?v=4)](https://github.com/tdgroot "tdgroot (9 commits)")[![Copilot](https://avatars.githubusercontent.com/in/1143301?v=4)](https://github.com/Copilot "Copilot (5 commits)")[![jellesiderius](https://avatars.githubusercontent.com/u/8039493?v=4)](https://github.com/jellesiderius "jellesiderius (4 commits)")[![MaximGanses](https://avatars.githubusercontent.com/u/58943509?v=4)](https://github.com/MaximGanses "MaximGanses (3 commits)")[![jbrada](https://avatars.githubusercontent.com/u/7402947?v=4)](https://github.com/jbrada "jbrada (1 commits)")

### Embed Badge

![Health badge](/badges/taurus-media-magento2-varnish-extended/health.svg)

```
[![Health](https://phpackages.com/badges/taurus-media-magento2-varnish-extended/health.svg)](https://phpackages.com/packages/taurus-media-magento2-varnish-extended)
```

###  Alternatives

[fastly/magento2

Fastly CDN Module for Magento 2.4.x

1564.2M1](/packages/fastly-magento2)[lizardmedia/module-varnish-warmer

Varnish Cache Warmer Magento2 module by Lizard Media

6276.8k](/packages/lizardmedia-module-varnish-warmer)[litespeed/module-litemage

LiteMage Full Page Cache for LiteSpeed Web Server

3254.8k](/packages/litespeed-module-litemage)[elgentos/magento2-varnish-extended

This extension extends the built-in Varnish functionalities

6510.9k](/packages/elgentos-magento2-varnish-extended)[vendic/module-optimize-cache-size

Magento 2 extension that reduces the number of cache keys by removing catalog\_product\_view\_id\_, catalog\_product\_view\_sku\_, catalog\_product\_view\_attribute\_set\_, catalog\_category\_view\_id\_ layout handles by default

3453.6k](/packages/vendic-module-optimize-cache-size)[redchamps/module-easy-cache-clean

Clean invalidated cache(s) easily in a Magento 2 store

2838.0k](/packages/redchamps-module-easy-cache-clean)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
