You are here

README.txt in Varnish 7

Same filename and directory in other branches
  1. 8 README.txt
This module provides integration between your Drupal site and the
Varnish HTTP Accelerator, an advanced and very fast reverse-proxy system.
Basically, Varnish handles serving static files and anonymous page-views
for your site much faster and at higher volumes than Apache,
in the neighborhood of 3000 requests per second.


## What does it do?
The main function of the varnish.module is to dynamically expire/purge items
from the Varnish cache when things change in Drupal. Future innovations may
allow dynamic adjustment of the VCL (varnish configuration), but for now the
purpose is to clear the external cache on demand.


## Installation
First of all, you need to have Varnish installed on your server. For more
information on how to do this, please see:

http://www.varnish-cache.org/

Once you have Varnish working, use the module you need to do the following:

* Enable the module.
* Add something like this to your settings.php file:

// Add Varnish as a cache bin.
$conf['cache_backends'][] = 'sites/all/modules/varnish/varnish.cache.inc';


If you plan to use the expire module to be selective with your cache clearing you
should add as a new cache bin.

$conf['cache_class_external_varnish_page'] = 'VarnishCache';

If you are not going to use the expire module you should replace the default page
cache with varnish.

$conf['cache_class_cache_page'] = 'VarnishCache';

* Go to admin/config/development/varnish and configure your connection Varnish
  appropriately. It should be pretty straight forward from here on.


## Running the simpletests for Varnish
In order to test the Varnish module, you need a "working" Varnish
configuration that caches pages for anonymous users. You also need to specify
the variables that configures your Varnish connection in your $conf array in
your settings.php file.


## Troubleshooting
Please note that Varnish version 3 automatically configures a random key to
protect access to the control terminal, which the module needs to use. You
will either need to get the key from the secret key file (/etc/varnish/secret
in Ubuntu), or adjust your Varnish configuration not to use a key.

Debugging Varnish itself is beyond the scope of this module, but you can also
see if Varnish is functioning correctly with this site:

http://www.isvarnishworking.com/

There are also a number of resources available from the Varnish community:

http://www.varnish-cache.org/

File

README.txt
View source
  1. This module provides integration between your Drupal site and the
  2. Varnish HTTP Accelerator, an advanced and very fast reverse-proxy system.
  3. Basically, Varnish handles serving static files and anonymous page-views
  4. for your site much faster and at higher volumes than Apache,
  5. in the neighborhood of 3000 requests per second.
  6. ## What does it do?
  7. The main function of the varnish.module is to dynamically expire/purge items
  8. from the Varnish cache when things change in Drupal. Future innovations may
  9. allow dynamic adjustment of the VCL (varnish configuration), but for now the
  10. purpose is to clear the external cache on demand.
  11. ## Installation
  12. First of all, you need to have Varnish installed on your server. For more
  13. information on how to do this, please see:
  14. http://www.varnish-cache.org/
  15. Once you have Varnish working, use the module you need to do the following:
  16. * Enable the module.
  17. * Add something like this to your settings.php file:
  18. // Add Varnish as a cache bin.
  19. $conf['cache_backends'][] = 'sites/all/modules/varnish/varnish.cache.inc';
  20. If you plan to use the expire module to be selective with your cache clearing you
  21. should add as a new cache bin.
  22. $conf['cache_class_external_varnish_page'] = 'VarnishCache';
  23. If you are not going to use the expire module you should replace the default page
  24. cache with varnish.
  25. $conf['cache_class_cache_page'] = 'VarnishCache';
  26. * Go to admin/config/development/varnish and configure your connection Varnish
  27. appropriately. It should be pretty straight forward from here on.
  28. ## Running the simpletests for Varnish
  29. In order to test the Varnish module, you need a "working" Varnish
  30. configuration that caches pages for anonymous users. You also need to specify
  31. the variables that configures your Varnish connection in your $conf array in
  32. your settings.php file.
  33. ## Troubleshooting
  34. Please note that Varnish version 3 automatically configures a random key to
  35. protect access to the control terminal, which the module needs to use. You
  36. will either need to get the key from the secret key file (/etc/varnish/secret
  37. in Ubuntu), or adjust your Varnish configuration not to use a key.
  38. Debugging Varnish itself is beyond the scope of this module, but you can also
  39. see if Varnish is functioning correctly with this site:
  40. http://www.isvarnishworking.com/
  41. There are also a number of resources available from the Varnish community:
  42. http://www.varnish-cache.org/