Skip to content

The VIP Cache Personalization API

Audience segmentation is useful for serving different cached content to different constituencies in an audience. The VIP Cache Personalization API allows a new cache group to be created and users to be assigned to specific segments within that group.

For example, when introducing Beta features for a site, a new group called “beta” can be created to allow users to opt-in to those features. Two user segments can be created in that group: users who have opted into the beta and those who have not.

An unlimited number of groups can be created, and users can belong to multiple groups and segments. The higher the number of groups that exist, the higher the variance in caching responses. This can decrease cache efficacy and performance and should be used cautiously.

The VIP Cache Personalization API utilizes the Vary_Cache class to customize some of the behaviors of the page cache while still leveraging the power and scale provided by VIP’s CDN. At a technical level, when a user is assigned to an audience segment, the API sets a cookie defining the user’s group or groups.

Some common uses for the VIP Cache Personalization API:

  • Tailoring content to a user’s location with IP geolocation
  • Displaying different website features to a select group (e.g. Beta site)
  • A/B testing
  • Gating content until users opt-in (e.g. Accepting Terms and Conditions)
  • Content paywalls
  • Custom authentication systems for membership sites

Note

Review more details about the VIP Cache Personalization API and related code examples in the VIP MU plugins GitHub repository for the Vary_Cache class.

Limitation

Cache personalization cannot be applied to requests that bypass the page cache (e.g. requests made to WordPress environments by logged-in users).

The VIP Platform vip-go-seg cache segmentation cookie passes its assigned value to an application in the vary: x-vip-go-segmentation HTTP response header. If the passed value matches a segment string that is defined in application code, content from a specified cache bucket will be served in response.

Because it does not rely on the IP address of an end user, the vip-go-seg cookie can be successfully used to vary cache responses by a site that is behind a reverse proxy.

Encrypted audience segmentation

Encrypted audience segmentation is similar to audience segmentation, but ensures that it is not possible for even a very savvy technical user to change the segments they have been assigned to. Typical use cases for this are paywalls, authenticated content, and other situations where it is desired for cached content to not be visible to a user based on encrypted credentials.

At a technical level, the cookie defining the group or groups the user is part of contains an encrypted string that cannot be read or altered by the user without scrambling the content.

The option to encrypt audience segmentation is not enabled by default. Customers can create a VIP Support request and indicate which environment(s) should enable this feature.

Last updated: November 19, 2025

Relevant to

  • WordPress