You are here

README.txt in Authenticated User Page Caching (Authcache) 7.2

INSTALLATION
============

* Install and enable authcache and authcache_varnish modules.
* Navigate to Administration » Configuration » Development and set "Expiration
  of cached pages" to an appropriate value (> 0).
* Install and enable the varnish and expire modules in order to have means to
  invalidate the cache when necessary.
* The example.vcl file includes snippets of code to add to your Varnish
  configuration to make authcache_varnish work. If you have an existing
  Varnish configuration file, it is recommended to start with example.vcl
  and add bits from your own file to it.
* Optionally enable authcache_debug. Uncommenting the appropriate lines in
  vcl_deliver in order to make the cache-hit indicator on the debug widget
  work.

The module and the VCL is based on the ideas of Josh Waihi. Please refer to
his excellent blog post for further background:
* http://joshwaihi.com/content/authenticated-page-caching-varnish-drupal

Detailed documentation with screenshots and additional notes is available
online in the Drupal Administration & Security Guide:
* https://www.drupal.org/node/2162047

The test folder contains a test-suite for the example.vcl. Run it by issuing
"make check". If you like to test your own version of the VCL, point the
AUTHCACHE_VCL variable to your file, e.g.:

    make check AUTHCACHE_VCL_FILE=/path/to/my/authcache.vcl


SETTINGS
========

Authcache Varnish verifies whether a request is coming in through a trusted
proxy server. Therefore it is necessary to properly configure reverse proxy
support in settings.php. E.g:

    $conf['reverse_proxy'] = TRUE;
    $conf['reverse_proxy_addresses'] = array('a.b.c.d');
    // Replace 'a.b.c.d' with the IP address of the reverse proxy server.

Some web servers restore the original client IP address before before handing
over the request to PHP/Drupal, e.g. Nginx when configured with the real_ip
module. In this case a shared secret can be configured in settings.php as well
as in the vcl_miss() subroutine.

    $conf['authcache_varnish_passphrase'] = 'correct horse battery staple';

For testing purposes it is possible to disable the reverse proxy check by
placing the following line into the settings.php file:

    $conf['authcache_varnish_validate_reverse_proxy_address'] = FALSE;

Beside the reverse proxy address Authcache Varnish also tests whether the
X-Varnish header is on the request. In order to disable this check, place the
following line into settings.php:

    $conf['authcache_varnish_header'] = FALSE;

Also it is possible to specify another header which should be checked by
specifying the $_SERVER-key accordingly. E.g. when Authcache Varnish should
verify the presence of X-Fancy-Proxy, introduce the following line into your
settings.php:

    $conf['authcache_varnish_header'] = 'HTTP_X_FANCY_PROXY';

File

modules/authcache_varnish/README.txt
View source
  1. INSTALLATION
  2. ============
  3. * Install and enable authcache and authcache_varnish modules.
  4. * Navigate to Administration » Configuration » Development and set "Expiration
  5. of cached pages" to an appropriate value (> 0).
  6. * Install and enable the varnish and expire modules in order to have means to
  7. invalidate the cache when necessary.
  8. * The example.vcl file includes snippets of code to add to your Varnish
  9. configuration to make authcache_varnish work. If you have an existing
  10. Varnish configuration file, it is recommended to start with example.vcl
  11. and add bits from your own file to it.
  12. * Optionally enable authcache_debug. Uncommenting the appropriate lines in
  13. vcl_deliver in order to make the cache-hit indicator on the debug widget
  14. work.
  15. The module and the VCL is based on the ideas of Josh Waihi. Please refer to
  16. his excellent blog post for further background:
  17. * http://joshwaihi.com/content/authenticated-page-caching-varnish-drupal
  18. Detailed documentation with screenshots and additional notes is available
  19. online in the Drupal Administration & Security Guide:
  20. * https://www.drupal.org/node/2162047
  21. The test folder contains a test-suite for the example.vcl. Run it by issuing
  22. "make check". If you like to test your own version of the VCL, point the
  23. AUTHCACHE_VCL variable to your file, e.g.:
  24. make check AUTHCACHE_VCL_FILE=/path/to/my/authcache.vcl
  25. SETTINGS
  26. ========
  27. Authcache Varnish verifies whether a request is coming in through a trusted
  28. proxy server. Therefore it is necessary to properly configure reverse proxy
  29. support in settings.php. E.g:
  30. $conf['reverse_proxy'] = TRUE;
  31. $conf['reverse_proxy_addresses'] = array('a.b.c.d');
  32. // Replace 'a.b.c.d' with the IP address of the reverse proxy server.
  33. Some web servers restore the original client IP address before before handing
  34. over the request to PHP/Drupal, e.g. Nginx when configured with the real_ip
  35. module. In this case a shared secret can be configured in settings.php as well
  36. as in the vcl_miss() subroutine.
  37. $conf['authcache_varnish_passphrase'] = 'correct horse battery staple';
  38. For testing purposes it is possible to disable the reverse proxy check by
  39. placing the following line into the settings.php file:
  40. $conf['authcache_varnish_validate_reverse_proxy_address'] = FALSE;
  41. Beside the reverse proxy address Authcache Varnish also tests whether the
  42. X-Varnish header is on the request. In order to disable this check, place the
  43. following line into settings.php:
  44. $conf['authcache_varnish_header'] = FALSE;
  45. Also it is possible to specify another header which should be checked by
  46. specifying the $_SERVER-key accordingly. E.g. when Authcache Varnish should
  47. verify the presence of X-Fancy-Proxy, introduce the following line into your
  48. settings.php:
  49. $conf['authcache_varnish_header'] = 'HTTP_X_FANCY_PROXY';