Drupal is a registered trademark of Dries Buytaert

acquia_cookie_vary

17 sites No security coverage
View on drupal.org

Acquia Cookie Vary is an off the shelf integration with the Acquia platform's Varnish infrastructure that allows for server-side variation on specific cookie values as documented by https://docs.acquia.com/acquia-cloud-platform/docs/performance/varnish/c....

This module is not maintained by anyone representing Acquia, but rather individuals from the Drupal community.

Why server-side cache variation?

Unlike the typical javascript driven segmentation and personalization techniques that are commonly found on the web, server-side solutions offer extreme performance and user experience benefits.

  1. Flashes of original or unstyled content are completely eliminated.
  2. Content layout shifting is completely eliminated.
  3. Pages arrive 100% intact served by a full page caching layer.

Post-Installation

This module simply adds the appropriate Vary headers based on the cache contexts that are present on a page. For example, if the following cache contexts are present on a given page: cookies:acquia_a, cookies:acquia_b, cookies:acquia_c, then this module adds Vary values for X-Acquia-Cookie-A, X-Acquia-Cookie-B, X-Acquia-Cookie-C.

Optional end-user named cookie

The Acquia platform supports a single end-user named cookie. This module provides a settings form that allows a site owner to configure the cookie name. Configuring such a value and providing an appropriate cache context will result in the response varying on X-Acquia-Cookie-Key and X-Acquia-Cookie-Value.

Debugging

Because caching is hard, an optional debug mode setting is provided. Setting debug mode will add custom response headers with their corresponding cookie values. For example, a request with a cookie acquia_a=test to a page that has a cache context of cookies:acquia_a with debug mode enabled will result in a custom response header of X-Acquia-Cookie-A: test being added.

Additional Requirements

If your project is hosted behind a CDN like Cloudflare, additional steps are required:

  1. If you are an enterprise customer, utilize the Cache Keys feature to vary on the appropriate individual cookies.
  2. If you are not an enterprise customer, a cache bypass rule will need to be added to any paths that must vary on specific cookie values.

Performance Notes

Cache variation inevitably leads to more primary memory used by Varnish. As such, there may come a time when the variation causes premature cache evictions. Acquia customers cannot access these critical metrics in a self-service fashion, but instead must submit a support ticket asking for the LRU Nuked rate.

Special Thanks

A very special thank you goes out to Lanette Miller for her invaluable assistance in this endeavor. None of this would not have been possible otherwise.

Activity

Total releases
2
First release
Feb 2025
Latest release
1 year ago
Release cadence
0 days
Stability
0% stable

Releases

Version Type Release date
1.0.0-alpha1 Pre-release Feb 25, 2025
1.0.x-dev Dev Feb 25, 2025