Acquia’s Varnish® configuration enforces policies for static files served from applications on Cloud Platform. In certain circumstances, these configurations can be modified by changing your website’s .htaccess file.
modulesthemesfileslibrariesX-Static-Asset:True
htmhtmlcssjsjsonymlxmltxtgifpngjpgjpegpdfsvgicowebpoggogvwebmmp3mp4movf4vdocttfeotpptxlsotfwoffwoff2tbzbz2rar
Common file types excluded from Varnish cachingCache-Control.htaccess
Common file types excluded from Varnish caching
The following file types (which are generally large in size) are always excluded from Varnish caching:
dmgexegzmsipkgtgzzip
You should use a content delivery network (CDN), such as Edge, or another external storage system for serving larger assets of these types.
Files greater than 10 MB in size
HTTP responses with a Content-Length header larger than 10MB (10,000,000 bytes) in size cannot be cached, but will instead be streamed.
To preserve website uptime and availability, either use a content delivery network (such as Edge) or another external storage system for serving large assets.
Creating custom caching policy per file type
If you want to set a specific cache policy for certain file types, you can add lines to your .htaccess file to set a custom Cache-Control HTTP header per file type, based on the following example:
# Exclude files of the following types from Varnish caching
<FilesMatch "\.(iso|bmp|psd|flac|avi|mpeg)$">
Header set Cache-Control "max-age=0, private, no-store, no-cache, must-revalidate"
</FilesMatch>Using the Purge file module
Through the Purge file module, you can efficiently manage and clear static file caches, improve your content update workflows, and reduce dependency on manual cache clearing. This module ensures that outdated static files are not served and instead, the updated version of such files are served through communication with Varnish and other caching layers. This module works only on files that are managed by Drupal and does not handle files uploaded by SFTP or some other way.