Varnish caching

Varnish is a caching tool that can greatly increase website performance. If you’re new to Varnish, learn more about it from Adam Malone’s Varnish for Beginners blog post.

Varnish operates by storing anonymous user connections and then serving them from memory, instead of making requests to the web server. For this reason, Cloud Platform uses Varnish in front of its load balancers. For information about how to enable your Cloud Platform website to use Varnish, see Using Varnish.

For Drupal 7, ensure that your site isn’t setting a SESS (session) cookie, which will invalidate Varnish caching on Cloud Platform. The Varnish module is not compatible with Cloud Platform.

By default, all static files are cached for two weeks as part of the standard Drupal installation. In the standard Drupal .htaccess file you will find this:

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

Cloud Platform Varnish does not, by default, cache SESSION cookies, HEAD or POST requests, objects over 10 MB, and some edge cases. Cloud Platform Varnish also will not cache HTTP status codes above a 301; see Caching redirects in Varnish.

Additional caching information

For more information about caching on your Drupal website, see Caching overview.

You may also find these documents useful:

More Information