---
title: "Purge cached files in Varnish - D7 workaround"
date: "2022-03-14T22:33:50+00:00"
summary:
image:
type: "article"
url: "/acquia-cloud-platform/help/94541-purge-cached-files-varnish-d7-workaround"
id: "803e5b03-f6aa-41f9-b464-828a3289aa93"
---

Acquia Purge does not purge static files from Varnish.  If static files are cached due to the following standard .htaccess code:

    # Requires mod_expires to be enabled.
    <IfModule mod_expires.c>
      # Enable expirations.
      ExpiresActive On
     
      # Cache all files for 2 weeks after access (A).
      ExpiresDefault A1209600

And if files are:

*   Accessible via http and https.
*   Cached on both Acquia balancers.
*   Cached on several domains, including a CDN origin domain.

The following bash script can be used to purge files for Drupal 7 sites:

(modify the following variable to conform to your site: \`bals\`, \`domains\`, \`protocols\`, \`path\`)

    bals="bal-59xx bal-59xx"
    domains="supportforums.xxxxx.com cxx-test4.xxxx.com origin-supportforums.xxxxx.com"
    protocols="http https"
    path="/"$1
    for bal in $bals
    do
      for domain in $domains
      do
        for protocol in $protocols
        do
          url="$protocol://${bal}.prod.hosting.acquia.com${path}"
          echo $url $domain
          curl -k -sX PURGE -H "X-Acquia-Purge: xxxxsupport" -H "Accept-Encoding: gzip" -H "Host: $domain" $url | grep -i title
        done
      done
    done