Datafile
The datafile contains the complete configuration of an environment for one organization. It contains all flags and tests that are active and links the audiences required for those entries.
Url
http://improve.obelism.studio/config/:organizationId/:environment
- Method:
GET
organizationId
- Unique identifier of the organization;org_XXX
environment
- environment to load;'develop | 'staging' | 'production'
Caching
Loading the datafile is one of the metrics on Improve that could increase costs. If you'd run an test on the server and want to post analytics from the client, this could mean two requests to the datafile per visitor. To make sure you don't rapidly chew through your usage plan you can cache this file in a few ways;
Add a caching layer
Instead of requesting the file from Improve for every visitor you could place it in your own key/value storage (like Redis). Here you can configure a time-to-live, ttl for short, and load it once every 5 minutes or per hour. This can be a great solution if you're not making changes on the fly. However keep in mind that disabling all traffic from a flag back to the original will have the caching time as a delay.
Statically generate
If you hardly make any changes in your config but you have one AB test running for a few weeks, or you're a solo developer that can easily deploy when you make a change, it could be an idea to grab the file on deploy and host it yourself in your project. A way of doing this is with pre-deploy scripts. For example if you host using Github actions you could add a task to grab it then. For hosting providers like Vercel and Netlify you utilize a prebuild script to download the latest datafile at that point.