Post preview
PHOENIX MEDIA

Now available: Varnish 4.2.0

A new version of the „PageCache powered by Varnish“ is out now. The following gives an overview of the latest release.

WHAT’S NEW

As with Version 4.2.0 of “PageCache powered by Varnish” we are now supporting frontend form keys, introduced in Magento EE 1.13 and CE 1.8.

WHAT IT DOES

Frontend form keys are meant to secure Magento by comparing a token stored in the user session with a submitted token in form data. By having a caching layer in front of Magento the HTML code, containing the form and the token, is going to be cached. As a result, many clients are going to have the same token in the form but different tokens in their session.

HOW IT WORKS

We addressed this issue in the following way:

  • We replaced all frontend form key tokens with an esi call
  • The esi call is captured and handled directly by Varnish
  • A new token is generated by Varnish and stored for all subsequent requests
  • On the client side the token is stored in a session cookie
  • If Varnish finds this cookie in further requests it will use the token from there
  • This results in a completely transparent frontend form key handling that is solely managed by Varnish.

WHAT DOES IT MEAN FOR ME

With this version you are now able to benefit from the “PageCache powered by Varnish” module as well as from the latest Magento version. Prior to this version ESI was only supported (and needed) for the Enterprise Edition of our module. As with this version you have to enable ESI support within your Varnish server.

HOW TO UPDATE TO THE LATEST RELEASE

Updating is easy: Grab yourself the latest version from GitHub or Magento Connect. You just have to make a few changes on the Varnish server side. In order to make Varnish handle ESI tags you have to add -p esi_syntax=0×03 to the startup parameters.

Furthermore you’ll need the vars.vcl file that is bundled with the module. You have to copy vars.vcl fromapp/code/local/Phoenix/VarnishCache/etc to exactly the same folder that holds your Varnish default vcl configuration. Make sure you use the latest default_3.0.vcl which comes with the version you've downloaded.

Special thanks goes to the excellent Varnish support team. These guys do a really good job and they helped us a lot to make Version 4.2.0 happen, kudos to the team!

Zurück