Dev guideAPI Reference
Dev guideAPI ReferenceUser GuideGitHubNuGetDev CommunityDoc feedbackLog In
GitHubNuGetDev CommunityDoc feedback

Get the datafile

How to synchronize your application with the datafile in Optimizely Feature Experimentation.

The datafile is a JSON representation of the current state of flag rules for an environment in your Feature Experimentation project. It contains all the data needed to deliver and track your flag deliveries and experiments. By synchronizing a local copy of this datafile, the SDK can run flag rules without making blocking network requests to an outside API, ensuring microsecond latency.

Synchronize your application with the datafile using the following methods:


When choosing how you synchronize the datafile, consider the tradeoffs between accuracy and latency. The more frequently your application gets the datafile, the more accurate your application is with the Optimizely Feature Experimentation project environment, but the more latency you generate through network traffic. If you want to centralize your network connections to the datafile, consider using Optimizely Agent.

Datafile refresh rate

The datafile updates when you save changes to your flags in the Optimizely app, and changes are typically reflected in datafile within ~2 seconds. The time depends on the SDK language and version, the synchronization method, and the local cached copy version. If you are experiencing delays longer than 15 seconds, contact Optimizely Experimentation support.

Synchronize across the SDKs

If you prefer not to synchronize each of your SDK instances individually with the Optimizely CDN, you can fetch the datafile through a single instance of the SDK, then pass that to other instances. For an example use case, see Multiple SDK implementations and Sharing the datafile with client SDKs.

Agent microservice endpoint

Fetch the datafile for an Agent microservice instance through the get datafile endpoint.

View the datafile through the app

For troubleshooting purposes, you can view the datafile in the Optimizely app. For secure environments, accessing the datafile in this manner is not supported. Instead, you can access the datafile at initialization, passing the datafile access token for authentication.

To access the datafile for your Full Stack project:

  1. Go to Settings > Environments.

  2. Click the Datafile URLs for the environment to open the CDN link in a new browser tab or window.

    select datafile urls to see the datafile

The following image shows how the datafile appears when accessed from the CDN URL in the app. You can also use this URL for implementing your own custom datafile fetching.

example datafile

Example datafile

See Example datafile to see an example in properly formatted JSON.