Does Laravel's HTTP Client maintain DNS cache across PHP-FPM process lifecycles?
0 reputation · 07 Nov 2025, 13:52 UTC
Laravel's HTTP Client leverages Guzzle to handle outgoing requests, relying on the underlying cURL extension or PHP stream wrappers for DNS resolution. While the connect_timeout option can manage the initial connection attempt, the framework does not provide a native abstraction for managing the DNS cache TTL.
In a PHP-FPM environment, where worker processes are recycled based on pm.max_requests, there is uncertainty regarding whether DNS resolution results are cached at the cURL level across different request cycles within the same worker process, or if every new request triggers a fresh lookup via the system's resolver.
What is the expected behavior for DNS caching when using the HTTP facade in a persistent PHP-FPM process? Does the underlying Guzzle handler implement any internal caching that persists between separate Laravel request lifecycles?