Date Published: February 5, 2025
Avoiding Varnish-cached pages
High-traffic Drupal sites often improve website performance by using Varnish caching, which stores cached copies of a website's rendered content in memory for faster and more efficient access. Acquia-hosted websites use a separate server, known as the load balancer, for the Varnish cache.
However, despite its benefits, using Varnish can introduce issues for your website's developers, testers, editors, and content providers.
For instance, when a developer visits your website to see their most recent content changes, Varnish returns the last rendered version of pages even if there were newer updates to the content. Varnish continues to show cached pages until they have pd their configured lifetimes and have expired. Also, Varnish is an external cache, so either clearing the cache on your web server from the website UI or using Drush won't resolve the issue.
Serving pages directly from the web server¶
You can use a technique called cache busting to avoid the cache and obtain content directly from the web server, loading more recent changes into your web browser. To do this, simply add a bogus HTML query to the end of the URL of the page that you want to display.
For example, you can add a slash ( /
) to the end of the URL. This exact webpage request has not yet (usually) been cached, [acquia-product:ac] will bypass Varnish and serve the page directly from the web server.
Note
Varnish caches each new URL that's served, so you must add a different phrase to the end of each URL if you need to continue to bypass the Varnish cache. In this case, you can add items to the end of the URL that are formatted similarly to the following:
Did not find what you were looking for?
If this content did not answer your questions, try searching or contacting our support team for further assistance.