3

I have a setup with Varnish. Varnish decides when to clear the cache for a page according to the PHP headers. I want to force Varnish to regenerate the cache for each node every time it gets updated by an user. I am looking for the best place to do this. Ideally it would be in a Drupal/pressflow hook (if there is any available) implemented in a custom module.

  • What HTTP caching directives Pressflow sets?
  • In what function, file and line number?

Answers that don't address those two bullet points will be appreciated, but not accepted.

2

The varnish module handles clearing the cache for you when a node is update via a socket connection to varnish. It can also be configure to clear the cache based on a lifetime period. If you still need to clear the cache based on your own custom requirements the module also provides a helper function such as _varnish_terminal_run that allows you to send commands to varnish from your php code.

Also in regard to the bullet point checkout the drupal_page_cache_header_external in pressflows bootstrap.inc file

There is also more documentation of varnish with pressflow over at fourkitchens wiki

  • Oh yeah and the drupal_page_cache_header_external runs if you have set up your page caching to be external in the performance configuration page. – ericduran Apr 13 '11 at 22:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.