Experimental project

This is a sandbox project, which contains experimental code for developer use only.

This module provides functionality for serving pages for authenticated users from Varnish cache.

It requires modification of the Varnish vcl file (provided in the example.vcl file), which diverts incoming requests to an access_check.php file. Here a very-quick DRUPAL_BOOTSTRAP_SESSION is made, which checks the user is authenticated, the result is then passed back to the vcl, and a cacheable page is then retrieved.

The setup is based on a tutorial found here: http://joshwaihi.com/content/authenticated-page-caching-varnish-drupal

This module is a working example of how to provide authenticated page caching, however it's use-case is quite specific and may need to be modified for your own requirements.

You should use this module if have a role on your site where everyone sees the same content.
You should be aware that although the user is "authenticated", they are still the anonymous user (just modified to have the authenticated role(s)). So anything that is dynamic and custom to an individual user will not work. (You could use ESI to include these elements.)
This also include form tokens, you may wish to check out the Cacheable CSRF protection module for these.

Project information