Skip to content

Latest commit

 

History

History
9 lines (5 loc) · 1.48 KB

php.md

File metadata and controls

9 lines (5 loc) · 1.48 KB

LaunchDarkly Relay Proxy - Using PHP

(Back to README)

The PHP SDK communicates differently with LaunchDarkly than other LaunchDarkly SDKs because it does not support long-lived streaming connections. It must either use HTTP to poll for flags on demand, or get them from a feature store with the Relay Proxy. We recommend using the Relay Proxy with a feature store, as it is more efficient than polling for flags on demand. To view an example of this, read Daemon mode.

If you don't use a feature store, the Relay Proxy can handle HTTP requests from PHP when in proxy mode. However, we strongly recommend that if you do this, you use the ttlMinutes parameter in the environment configuration to enable HTTP caching. This is equivalent to the TTL setting for the environment on your LaunchDarkly dashboard, but must be set here separately because the Relay Proxy does not have access to those dashboard properties. This causes HTTP responses from the PHP endpoints to have a Cache-Control: max-age so the PHP SDK will not make additional HTTP requests for the same flag more often than that interval.

This configuration may result in different PHP application instances receiving flag updates at slightly different times, because their HTTP caches will not be exactly in sync.