Reverse proxy

By implementing a reverse proxy, you're serving Didomi's SDK and API assets through your own domain.

With a reverse proxy, all traffic to your custom domain will be routed first to your infrastructure before being proxied to Didomi if needed. A reverse proxy allows you to do caching and traffic management.

The benefits of a reverse proxy are:

  • Enhance performance by leveraging Cloud and Edge providers' caching functionalities.

  • Maintain brand consistency and reduce reliance on third-party domains.

  • Potentially improve compliance with privacy regulations by controlling SDK delivery.

Main domain vs Subdomain Implementation

When implementing a reverse proxy for the Didomi SDK and its API events, you need to choose between using your main domain or a dedicated subdomain. This choice has important implications for Safari's cookie restrictions.

Main domain implementation: Serves the SDK through as a subpath on your primary domain (e.g., domain.com/consent/* or www.domain.com/consent/*) that users access your website on.

Dedicated subdomain implementation: Serves the SDK through a separate subdomain (e.g., sub.domain.com) directed to the Didomi CMP.

Key Considerations

Safari ITP Restrictions (Safari 16.4+): Safari compares IP addresses between your main domain and the subdomain setting a cookie. If the first 16 bits differ, cookies from the subdomain are limited to 7 days. Using your main domain allows consent cookies to maintain their lifespan up to regulatory recommendations.

Consent storage requirements: CNIL (for French customers) recommends storing consent choices for at least 6 months to avoid repeated consent requests. The 7-day Safari limitation forces more frequent reconsent than regulatory guidelines suggest.

Implementing a reverse proxy on your main domain solves both Safari's cookie restrictions and regulatory compliance requirements.

Safari ITP resilience
Consent storage requirements
Implementation complexity
Requires code

Subdomain

🟡 Medium

Most often, except on AWS

Main domain

🟠 High - involves implementing a custom path routing

Yes

Set up a reverse proxy

You can implement your own reverse proxy by following the reverse proxy guidelines.

You can also use one of the implementation guides to set up a reverse proxy with:

Last updated