wsh-sse-optimization

Installation
SKILL.md

WSH: SSE Streaming Optimization

Optimizing Server-Sent Events (SSE) streaming where character-by-character emission causes thousands of events and React re-renders, destroying TBT scores.

Use this skill when the Crok AI chat SSE endpoint streams individual characters, causing excessive client-side re-renders.

Techniques

Server-Side: Batch Characters into Chunks

Instead of emitting one SSE event per character, batch into word/sentence-sized chunks.

// Before: char-by-char (thousands of events)
for (const char of response) {
  res.write(`event: message\nid: ${messageId++}\ndata: ${JSON.stringify({ text: char, done: false })}\n\n`);
}
Installs
1
Repository
mazrean/wsh2026
First Seen
Jun 19, 2026
wsh-sse-optimization — mazrean/wsh2026