Download the PHP package elgentos/magento2-varnish-extended without Composer

On this page you can find all versions of the php package elgentos/magento2-varnish-extended. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package magento2-varnish-extended

VCL Tests

Elgentos_VarnishExtended

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

Configurable tracking parameters

The core Magento 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 > Config > System > Full Page Cache > Varnish Configuration > Tracking Parameters in the backend to customize your own parameters.

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

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: 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

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:

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

You can place it in your Git repo in app/etc/varnish6.vcl and automate applying it through Deployer on each deploy with the following Deployer task.

Contrary to popular belief, loading & 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

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

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:

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:

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

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. You will also find information on the Varnish Test Case syntax.


All versions of magento2-varnish-extended with dependencies

PHP Build Version
Package Version
Requires magento/framework Version >=103.0.7
magento/module-page-cache Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package elgentos/magento2-varnish-extended contains the following files

Loading the files please wait ....