Edit environment settings

This topic explains how to edit environment settings in LaunchDarkly.

This topic explains how to edit environment settings in LaunchDarkly.

Each environment has its own settings that control how LaunchDarkly behaves for that stage of your development lifecycle. You can configure safeguards to protect critical environments, manage SDK credentials, and set flag change approval requirements.

Edit environment settings

To view or update environment settings:

  1. Click the project dropdown. The project menu appears:

The project menu.

The project menu.
  1. Select Project settings.
  2. Select Environments. The Environments list appears.
  3. Click the three-dot overflow menu next to your environment.
  4. Select Edit environment.
  5. Update settings using the Overview, Approvals, or SDK keys tabs.
  6. Save or cancel your changes before changing tabs or leaving the page.

The Overview tab includes general environment settings and safeguards. For details on individual settings, read Critical environments, Tags, and Secure mode. The following table describes each setting:

SettingDescriptionLearn more
NameThe environment name
TagsCustomizable labels used for categorizationTags
Critical environmentAn environment that affects your customers or the health of your systemsCritical environments
Require commentsWhether to require a comment before saving flag or segment changesRequired comments
Require confirmationWhether to require entering the name of the environment before saving flag or segment changesRequired confirmation
Enable secure modeEnsures that one end user cannot inspect flag variations for another end user when you use some client-side SDKsSecure mode
Send detailed events to Data Export destinationsWhether to export evaluation events for end users that encounter the flagData Export
TTLNumber of minutes that the PHP SDK can cache feature flag rules locallyTTL settings
Environment ColorThe color used to indicate this environment in the LaunchDarkly UI

The Approvals tab controls flag change and segment approval requirements for the environment. To learn more, read Configuring approvals for an environment.

Use the SDK keys tab to create and manage SDK keys and mobile keys for the environment. To learn more, read SDK credentials.

TTL settings

TTL settings are only used in the PHP SDK

This setting controls how long the PHP SDK can cache feature flag rules locally. You only need to configure this if you are using the PHP SDK.

The time-to-live (TTL) setting controls how long the PHP SDK caches feature flag rules locally. Because PHP’s shared-nothing architecture does not support LaunchDarkly’s streaming model, the PHP SDK relies on this local cache instead. To learn more about the PHP SDK, read the PHP SDK reference.

For production environments, we recommend setting the TTL to at least five minutes. This reduces the number of remote requests the SDK makes, since most calls to variation resolve from the local cache. The tradeoff is that flag rule changes take up to five minutes to propagate. For lower-traffic sites with fewer than one request per minute, a higher TTL makes better use of the local cache.

Setting the TTL to zero disables the local cache entirely, and every call to variation makes a remote request to the LaunchDarkly CDN. A zero-minute TTL can be useful in testing environments where you need changes to reflect immediately, but we do not recommend it in production. For high-volume PHP environments, we strongly recommend using the Relay Proxy instead. To learn more, read The Relay Proxy.

To set the TTL:

  1. Click the project dropdown. The project menu appears.
  2. Select Project settings.
  3. Select Environments. The Environments list appears.
  4. Click the three-dot overflow menu next to your environment.
  5. Select Edit environment.
  6. Click the Overview tab if it is not already selected.
  7. Enter a value in the TTL input (0-60 minutes) field.
  8. Click Save environment.