Skip to content

Releases: rapiddive/quickchart-php

v2.1.0 — Performance improvements

24 Jun 14:30

Choose a tag to compare

What's new

Performance improvements

  • cURL connection sharing — A shared SSL session and DNS cache is maintained per QuickChart instance. Repeated calls to toBinary() / 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) and timeout (default: 30 s) options prevent scripts from hanging indefinitely on slow or unreachable hosts. Both can be set via constructor options or the new setConnectTimeout() / setTimeout() methods.

  • HTTP response compression — Requests now include Accept-Encoding: gzip, deflate automatically. libcurl handles decompression transparently; the JSON response from getShortUrl() 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 cachingjson_encode() is called at most once per array config. The cached result is invalidated when setConfig() 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

  • timeout now defaults to 30 s and connectTimeout to 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.