You are here

README.txt in Purge 6

Same filename and directory in other branches
  1. 7.2 README.txt
Purge
The purge module clears urls from reverse proxy caches like Varnish
(http://varnish-cache.org/), Squid (http://www.squid-cache.org/) and Nginx
(http://nginx.net/) by issuing an http PURGE request to them. It works in 
conjunction with the Cache Expiration (http://drupal.org/project/expire)
module to act on events that are likely to expire urls from the proxy cache.
This allows delivering content updates faster to end users.

Requirements:
- A cachable version of Drupal 6. This can be an official Drupal release with
a patch applied (http://drupal.org/node/466444) or use Pressflow
(http://pressflow.org/), a cachable friendly fork of Drupal.
- One or more reverse proxy caches (http://en.wikipedia.org/wiki/Reverse_proxy)
like Varnish (recommended), Squid or Nginx that point to your webserver(s).
- Varnish needs a modification to its configuration file. See this section in the
Varnish section in the Drupal handbook: http://drupal.org/node/1054886#purge
- Squid needs to have purging enabled in its configuration. See
http://docstore.mik.ua/squid/FAQ-7.html#ss7.5
- Nginx needs an extra module and configuration. See 
http://labs.frickle.com/nginx_ngx_cache_purge/ and the installation hints below.
Also see this issue http://drupal.org/node/1048000 for more background info
- PHP with curl(http://php.net/manual/en/book.curl.php) enabled. The Purge
module uses curl for issuing the http PURGE requests.
- Purge integrates with the expire module http://drupal.org/project/expire.
Without Expire or a mechanism to replace it, Purge won't act.

Installation:
- Unpack, place and enable just like any other module.
- Navigate to Administration -> Site configuration -> Purge settings
- Set your Varnish or Squid proxy url(s) like "http://localhost" or
"http://192.168.1.23:8080 http://192.168.2.34:8080" for multiple hosts.
- If your using nginx you need to specify the purge path and the get method in
your proxy setting like this:
"http://192.168.1.76:8080/purge?purge_method=get"

Q&A:
Q: How do I know if its working?
A: Purge reports errors to watchdog. Also when running "varnishlog" on the
proxy your should see PURGE requests scrolling by when you (for instance)
update an existing node.

Q: How can I test this more efficiently?
A: The expire module has drush support so you can issue purge commands from
the command line. See http://drupal.org/node/1054584
You can also test if your proxy is configured correctly by issuing a curl
command in a shell on any machine in the access list of your proxy: 
curl -X PURGE -H "Host: example.com" http://192.168.1.23/node/2

Q: Why choose this over the Varnish module (http://drupal.org/project/varnish)?
A: Purge just issues purge requests to your proxy server(s) over standard http
on every url the expire module detects. It requires modification of your
Varnish configuration file.
The varnish module has more internal logic to purge your Varnish cache
completely, which can be more disruptive then the expire module integration it
also offers. It uses a terminal interface to communicate to varnish instead of
http. This allows for more features but also hands over full control over the
varnish instance to any machine having network access to it. (This is a
limitation of Varnish.) Also firewall or other security policies could pose a
problem. It does not require modification of your config file. If you have the
choice Varnish module is probably your best bet but Purge might help you out in
places where Varnish module is not an option.

Q: What happened to support for Acquia Cloud platforms?
A: This was dropped in the 1.x branches of Purge for the 1.7 releases. We're recommending the special purpose Acquia Purge Module at http://drupal.org/project/acquia_purge

Credits:
Paul Krischer / "SqyD" on drupal.org
paul@krischer.nl / sqyd@sqyd.net
Thanks:
Mike Carper / mikeytown2 on drupal.org, Author of Expire
Brian Mercer / brianmercer on drupal.org, nginx testing and debugging

Changelog:
1.0 Initial release. Basic purge functionality in place
1.1 Refactoring for Nginx and future platform support and better error handling
1.2 (Upcoming) Acquia Hosting support, form validation
1.3 Bugfix release. Issue 1235674. Output buffering patch by mauritsl on drupal.org.
1.7 Bugfix release and dropping Acquia support.

File

README.txt
View source
  1. Purge
  2. The purge module clears urls from reverse proxy caches like Varnish
  3. (http://varnish-cache.org/), Squid (http://www.squid-cache.org/) and Nginx
  4. (http://nginx.net/) by issuing an http PURGE request to them. It works in
  5. conjunction with the Cache Expiration (http://drupal.org/project/expire)
  6. module to act on events that are likely to expire urls from the proxy cache.
  7. This allows delivering content updates faster to end users.
  8. Requirements:
  9. - A cachable version of Drupal 6. This can be an official Drupal release with
  10. a patch applied (http://drupal.org/node/466444) or use Pressflow
  11. (http://pressflow.org/), a cachable friendly fork of Drupal.
  12. - One or more reverse proxy caches (http://en.wikipedia.org/wiki/Reverse_proxy)
  13. like Varnish (recommended), Squid or Nginx that point to your webserver(s).
  14. - Varnish needs a modification to its configuration file. See this section in the
  15. Varnish section in the Drupal handbook: http://drupal.org/node/1054886#purge
  16. - Squid needs to have purging enabled in its configuration. See
  17. http://docstore.mik.ua/squid/FAQ-7.html#ss7.5
  18. - Nginx needs an extra module and configuration. See
  19. http://labs.frickle.com/nginx_ngx_cache_purge/ and the installation hints below.
  20. Also see this issue http://drupal.org/node/1048000 for more background info
  21. - PHP with curl(http://php.net/manual/en/book.curl.php) enabled. The Purge
  22. module uses curl for issuing the http PURGE requests.
  23. - Purge integrates with the expire module http://drupal.org/project/expire.
  24. Without Expire or a mechanism to replace it, Purge won't act.
  25. Installation:
  26. - Unpack, place and enable just like any other module.
  27. - Navigate to Administration -> Site configuration -> Purge settings
  28. - Set your Varnish or Squid proxy url(s) like "http://localhost" or
  29. "http://192.168.1.23:8080 http://192.168.2.34:8080" for multiple hosts.
  30. - If your using nginx you need to specify the purge path and the get method in
  31. your proxy setting like this:
  32. "http://192.168.1.76:8080/purge?purge_method=get"
  33. Q&A:
  34. Q: How do I know if its working?
  35. A: Purge reports errors to watchdog. Also when running "varnishlog" on the
  36. proxy your should see PURGE requests scrolling by when you (for instance)
  37. update an existing node.
  38. Q: How can I test this more efficiently?
  39. A: The expire module has drush support so you can issue purge commands from
  40. the command line. See http://drupal.org/node/1054584
  41. You can also test if your proxy is configured correctly by issuing a curl
  42. command in a shell on any machine in the access list of your proxy:
  43. curl -X PURGE -H "Host: example.com" http://192.168.1.23/node/2
  44. Q: Why choose this over the Varnish module (http://drupal.org/project/varnish)?
  45. A: Purge just issues purge requests to your proxy server(s) over standard http
  46. on every url the expire module detects. It requires modification of your
  47. Varnish configuration file.
  48. The varnish module has more internal logic to purge your Varnish cache
  49. completely, which can be more disruptive then the expire module integration it
  50. also offers. It uses a terminal interface to communicate to varnish instead of
  51. http. This allows for more features but also hands over full control over the
  52. varnish instance to any machine having network access to it. (This is a
  53. limitation of Varnish.) Also firewall or other security policies could pose a
  54. problem. It does not require modification of your config file. If you have the
  55. choice Varnish module is probably your best bet but Purge might help you out in
  56. places where Varnish module is not an option.
  57. Q: What happened to support for Acquia Cloud platforms?
  58. A: This was dropped in the 1.x branches of Purge for the 1.7 releases. We're recommending the special purpose Acquia Purge Module at http://drupal.org/project/acquia_purge
  59. Credits:
  60. Paul Krischer / "SqyD" on drupal.org
  61. paul@krischer.nl / sqyd@sqyd.net
  62. Thanks:
  63. Mike Carper / mikeytown2 on drupal.org, Author of Expire
  64. Brian Mercer / brianmercer on drupal.org, nginx testing and debugging
  65. Changelog:
  66. 1.0 Initial release. Basic purge functionality in place
  67. 1.1 Refactoring for Nginx and future platform support and better error handling
  68. 1.2 (Upcoming) Acquia Hosting support, form validation
  69. 1.3 Bugfix release. Issue 1235674. Output buffering patch by mauritsl on drupal.org.
  70. 1.7 Bugfix release and dropping Acquia support.