PHPackages                             egyjs/progressive-json-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. egyjs/progressive-json-php

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

egyjs/progressive-json-php
==========================

Framework-agnostic Progressive JSON Streamer for PHP - breadth-first JSON streaming with placeholders, inspired by Dan Abramov's Progressive JSON.

1.1.0(11mo ago)43181MITPHPPHP &gt;=8.1CI passing

Since Jun 12Pushed 11mo ago1 watchersCompare

[ Source](https://github.com/egyjs/progressive-json-php)[ Packagist](https://packagist.org/packages/egyjs/progressive-json-php)[ Fund](https://www.buymeacoffee.com/egyjs)[ GitHub Sponsors](https://github.com/egyjs)[ RSS](/packages/egyjs-progressive-json-php/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (2)Versions (7)Used By (0)

Progressive JSON Streaming for PHP APIs
=======================================

[](#progressive-json-streaming-for-php-apis)

**TL;DR:** Progressive JSON Streaming sends data incrementally to show users page structure instantly while slow API calls complete in the background.

[![PHP Version](https://camo.githubusercontent.com/9847427b3ad37d5f2f3122f63983977e1b0ab038e06a24272d8c4514725c11a0/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e312532422d626c75653f7374796c653d666c61742d737175617265266c6f676f3d706870)](https://www.php.net/)[![Tests](https://camo.githubusercontent.com/91aa117799c852415a2ca987991855a1a7e4873fd969e443579cc32e0d9f678c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6567796a732f70726f67726573736976652d6a736f6e2d7068702f7068702d74657374732e796d6c3f6272616e63683d6d6173746572267374796c653d666c61742d737175617265266c6f676f3d676974687562266c6162656c3d5465737473)](https://github.com/egyjs/progressive-json-php/actions)[![Code Coverage](https://camo.githubusercontent.com/626c4ff4d14f4cd2df83768bd2e263a77ad81ca4cca238fd3bd1e95ebe3b256c/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f6567796a732f70726f67726573736976652d6a736f6e2d7068703f7374796c653d666c61742d737175617265266c6f676f3d636f6465636f76)](https://codecov.io/gh/egyjs/progressive-json-php)[![Latest Version](https://camo.githubusercontent.com/2c7cb31dd2776d1e6bebec23a973bffeaf206171b0df0ecca3d64dafbb6fe060/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6567796a732f70726f67726573736976652d6a736f6e2d7068703f7374796c653d666c61742d737175617265266c6f676f3d7061636b6167697374)](https://packagist.org/packages/egyjs/progressive-json-php)[![License](https://camo.githubusercontent.com/8ab0321cdbe3eed252ed15257b767bc830c12667312649933c93dda07790cea3/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6567796a732f70726f67726573736976652d6a736f6e2d7068703f7374796c653d666c61742d737175617265)](https://github.com/egyjs/progressive-json-php/blob/master/LICENSE)[![Sponsor on GitHub](https://camo.githubusercontent.com/800b283ae928d1e8c9080488dcbdb8ad6d856368f8f43f3bcc50de3777dc9828/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f53706f6e736f722d2545322539442541345f4769744875622d6666363962343f7374796c653d666c61742d737175617265266c6f676f3d676974687562)](https://github.com/sponsors/egyjs)

[![Progressive JSON Streamer Demo](/demo-of-progressive-json-streaming.gif)](/demo-of-progressive-json-streaming.gif)

> **Stream JSON responses progressively to improve user experience.** Send page structure instantly, then fill in slow data as it becomes available. Perfect for dashboards, homepages, and APIs mixing fast cached data with slow database queries.

Perfect for dashboards, homepages, and any API where some data loads fast (cache) and some loads slow (database/external APIs).

The Problem
-----------

[](#the-problem)

```
// Traditional API: User waits 2000ms to see anything
{
  "user": "...",          // Ready in 50ms
  "posts": "...",         // Ready in 200ms
  "analytics": "..."      // Takes 2000ms ← Everything waits for this
}
```

The Solution
------------

[](#the-solution)

```
