HomeGuidesAPI Reference
Submit Documentation FeedbackJoin Developer CommunityOptimizely GitHubOptimizely NuGetLog In

Backend Proxy

This is the documentation for Performance Edge. If you'd like access, please reach out to your Optimizely account manager.

Backend Proxy is another method of implementing Performance Edge.

It is not recommended as it usually leads to much poorer performance than implementing via Edge Subdomain or CDN proxy.

This is because the backend system serving as the proxy usually does not have the geographical proximity to your site visitors that a CDN or our Edge Worker does and can lead to requests taking much longer.

However, prior to the release of Edge Subdomain, this was an alternative for customers who couldn’t set up their CDN to proxy Performance Edge requests.

Here's how it works:

  1. Visitor requests your webpage, which includes a script request. The script tag can either be:
  • first party — e.g. reference a relative path such as /optimizely-edge/<project_id>.js
  • third party — e.g. referencing a different origin subdomain.customer.com/optimizely-edge/<project_id>.js

🚧

Note

Note that if the using a third part origin, you’ll need to add the following as an attribute on your script tag:
referrerpolicy="no-referrer-when-downgrade"

This referrerpolicy attribute is required to enable Optimizely to receive the referrer for page targeting purposes.

Starting in Chrome 85, Chrome will default to using the strict-origin-when-cross-origin referrer policy which would prevent Optimizely from getting the full URL of the page the visitor is viewing. Other browsers have indicated they plan to follow Chrome’s lead in this as well. Setting the referrer policy to the current default no-referrer-when-downgrade resolves this. Learn more about these referrer policies.

  1. Your backend should be configured to automatically fetch requests matching with /optimizely-edge/<project_id>.js from the Optimizely Edge Decider API (see the Settings tab in your Performance Edge project for the literal value for a given project).

  2. Optimizely's Edge Worker fetches the project or snippet datafile, evaluates URL targeting, makes decisions on any relevant experiments, and generates JavaScript (the microsnippet) that will apply changes for the selected variations, and inject the full snippet to be loaded asynchronously on the page.

  3. Optimizely's Edge Worker returns the microsnippet to your backend, which returns it as the response body of the script request.