Releases: rapiddive/quickchart-php
v2.1.0 — Performance improvements
What's new
Performance improvements
-
cURL connection sharing — A shared SSL session and DNS cache is maintained per
QuickChartinstance. Repeated calls totoBinary()/toFile()/getShortUrl()on the same instance reuse the warm TLS session, avoiding a full handshake on every request (saves 100–300 ms per call after the first). -
Configurable request timeouts — New
connectTimeout(default: 10 s) andtimeout(default: 30 s) options prevent scripts from hanging indefinitely on slow or unreachable hosts. Both can be set via constructor options or the newsetConnectTimeout()/setTimeout()methods. -
HTTP response compression — Requests now include
Accept-Encoding: gzip, deflateautomatically. libcurl handles decompression transparently; the JSON response fromgetShortUrl()typically compresses 40–70%. -
HTTP/2 opt-in — Uses HTTP/2 where the curl build supports it (
CURL_HTTP_VERSION_2_0), with automatic fallback to HTTP/1.1 on older builds. -
Config string caching —
json_encode()is called at most once per array config. The cached result is invalidated whensetConfig()is called.
Bug fixes
- Fixed a PHP 8.5 deprecation notice (
curl_share_close()is a no-op since PHP 8.0 and deprecated in 8.5). The call is now skipped on PHP 8+.
Upgrade notes
timeoutnow defaults to 30 s andconnectTimeoutto 10 s. Code that previously relied on unbounded request time can restore the old behaviour with$chart->setTimeout(0).- All other changes are fully backward compatible.