Problem/Motivation

Client/backend split:

In the past, Varnish has fetched the content from the backend in the same thread as the client request. In Varnish 4 we have split the client and backend code into separate trheads allowing for some much requested improvements. This split allows Varnish to refresh content in the background while serving stale content quickly to the client.

This split has also necessitated a change of the VCL-functions, in particular functionality has moved from the old vcl_fetch method to the two new methods vcl_backend_fetch and vcl_backend_response.

The split also restricts the availability of req.esi_level to client code. It is present in vcl_recv, but neither in vcl_backend_fetch nor in vcl_backend_response.

Proposed resolution

In order to minimalize the changes needed to migrate from Varnish 3 to Varnish 4, extract the logic from vcl_miss into vcl_recv and rewrite the necessary parts of vcl_fetch.

Also Varnish 4 does not cache anything if Cache-Control has the private directive. Therefore remove that from ESI responses. Note that responses prepared like this will never be sent to the client (and neither to downstream proxies).

Remaining tasks

User interface changes

API changes

CommentFileSizeAuthor
#1 adapt_varnish_3-2482227-1.patch4.09 KBznerol
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

znerol’s picture

Status: Active » Needs review
FileSize
4.09 KB

  • znerol committed 6ae16e3 on 7.x-2.x
    Issue #2482227 by znerol: Adapt Varnish 3 example.vcl such that...

  • znerol committed 6ae2985 on 7.x-2.x
    Issue #2482227 by znerol: Adapt Varnish 3 example.vcl such that...
znerol’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.