openscholar/openscholar — pull request #4645 by rbran100 (2013-12-06 21:34:14+00:00)
Title: Fix cache clear of image derivatives and wildcards for varnish

#4430

This is paired with a patch to "acquia_purge" in our acquia repo:
```patch
diff --git a/acquia_purge.module b/acquia_purge.module
index c27e35e..ebdbe84 100644
--- a/acquia_purge.module
+++ b/acquia_purge.module
@@ -110,9 +110,24 @@ function acquia_purge_menu() {
/**
* Implements hook_expire_cache().
*/
-function acquia_purge_expire_cache($paths) {
+function acquia_purge_expire_cache($raw_paths, $wildcards = array()) {
static $patterns;

+ $paths = array();
+ foreach ($raw_paths as $internal_path => $absolute_url) {
+ // Check if wildcard is enabled for this URL.
+ if(!empty($wildcards[$internal_path])){
+ //Break up aliased and internal paths for older acquia_purge
+ $paths[] = $internal_path."(.*)";
+ $paths[] = $absolute_url."(.*)";
+ }else{
+ //Break up aliased and internal paths for older acquia_purge
+ $paths[] = $internal_path;
+ $paths[] = $absolute_url;
+ }
+ }
+ $paths = array_unique($paths);
+
// Ask our built-in diagnostics system to preliminary find issues that are so
// risky we can expect problems. Everything with ACQUIA_PURGE_SEVLEVEL_ERROR
// will cause purging to cease and we've got to tell the end user.
```