◉RORK LABJP
●GPT-6.1 SOL — Added to Rork's model menu (09-29) with Low, Medium and High effort; included on Pro and Max●SONNET 5.5 — Claude Sonnet 5.5 is selectable: strong at UI design and faster than Sonnet 5 (09-28)●SONNET 4.5 — Retires on the Claude API on 11/30, 27 days left. If your app calls it, check the migration target●SDK 58 — Moves to React Native 0.88. R8 is now on by default in Android release builds, and iOS prebuild generates a SceneDelegate●OBSERVE — EAS Observe now records native crashes too (SDK 57.0.21 or later, 10/07)●NEW — My App Open Ad Only Showed When the App…●GPT-6.1 SOL — Added to Rork's model menu (09-29) with Low, Medium and High effort; included on Pro and Max●SONNET 5.5 — Claude Sonnet 5.5 is selectable: strong at UI design and faster than Sonnet 5 (09-28)●SONNET 4.5 — Retires on the Claude API on 11/30, 27 days left. If your app calls it, check the migration target●SDK 58 — Moves to React Native 0.88. R8 is now on by default in Android release builds, and iOS prebuild generates a SceneDelegate●OBSERVE — EAS Observe now records native crashes too (SDK 57.0.21 or later, 10/07)●NEW — My App Open Ad Only Showed When the App…
Articles/App Dev
◇ App Dev/2026-08-05Intermediate

A JSON File 19% Smaller That Ships Only 3% Smaller — Measuring Catalog Payloads Against gzip

Five payload formats measured on a 20,000-item wallpaper catalog. Key shortening saves just 3.2% after gzip, while a columnar layout cuts 26.8%. Real numbers for Brotli, paging, and JSON.parse time.

Rork611Expo234JSONgzipperformance11

✦ Premium Article

The catalog for a wallpaper app I operate had quietly grown past 20,000 items. The catalog JSON fetched right after launch weighed about 7MB uncompressed — close to 1MB even with gzip — and on slower connections the delay before first paint had become something you could feel.

The first thing I reached for was key shortening: imageUrl becomes u, fileSize becomes f. The file shrank by 19%, and for a moment I felt I had made progress. Then I measured what actually travels over the wire — the gzipped size — and the saving was 3.2%. A poor return for giving up readable field names.

So where do the real savings live? This is a record of testing each assumption until the numbers answered.

The Setup — a 20,000-Item Synthetic Catalog

Everything was measured with Node v22.22.3 and the built-in zlib module, nothing else. Since I cannot publish the production catalog, I generated synthetic data with the same field structure, using a seeded random generator. The seed is fixed, so running the script reproduces the exact byte counts below.

Each record has twelve fields typical of a wallpaper catalog: ID, title, category, a tags array, resolution, file size, two image URLs, a premium flag, a creation timestamp, and a sort score. Twenty thousand of them.

// gen.js — Node v22.22.3, no dependencies (zlib is built in)
const zlib = require('zlib');
const fs = require('fs');
 
// Seeded PRNG (mulberry32) so every run reproduces the same catalog
function mulberry32(a) {
  return function () {
    a |= 0; a = (a + 0x6D2B79F5) | 0;
    let t = Math.imul(a ^ (a >>> 15), 1 | a);
    t = (t + Math.imul(t ^ (t >>> 7), 61 | t)) ^ t;
    return ((t ^ (t >>> 14)) >>> 0) / 4294967296;
  };
}
const rand = mulberry32(20260805);
const cats = ['nature','city','space','abstract','animal','flower','sea','sky','night','minimal'];
const words = ['sakura','yozora','umi','yama','hikari','kaze','ame','yuki','hoshi','tsuki','asa','yugure','mori','kawa','sora','kumo'];
const pick = (a) => a[Math.floor(rand() * a.length)];
 
const N = 20000;
const items = [];
for (let i = 0; i < N; i++) {
  const id = i + 1;
  const cat = pick(cats);
  items.push({
    id,
    title: `${pick(words)}-${pick(words)}-${String(id).padStart(5, '0')}`,
    category: cat,
    tags: [pick(words), pick(words), pick(words)],
    width: [1080, 1170, 1290][Math.floor(rand() * 3)],
    height: [1920, 2532, 2796][Math.floor(rand() * 3)],
    fileSize: Math.floor(rand() * 4000000) + 200000,
    imageUrl: `https://cdn.example.com/wallpapers/${cat}/${id}/original.jpg`,
    thumbUrl: `https://cdn.example.com/wallpapers/${cat}/${id}/thumb.jpg`,
    premium: rand() < 0.2,
    createdAt: new Date(1600000000000 + Math.floor(rand() * 150000000000)).toISOString(),
    sortScore: Math.round(rand() * 100000) / 100,
  });
}

Against this baseline I prepared four transformations:

// B: shorten every key to one letter (imageUrl → u, etc.)
const KM = { id:'i', title:'t', category:'c', tags:'g', width:'w', height:'h',
             fileSize:'f', imageUrl:'u', thumbUrl:'v', premium:'p', createdAt:'d', sortScore:'s' };
const B = items.map((o) => { const r = {}; for (const k in o) r[KM[k]] = o[k]; return r; });
 
// C: drop both URLs (the client can rebuild them from category and id)
const C = items.map(({ imageUrl, thumbUrl, ...rest }) => rest);
 
// D: columnar — transpose the array of objects into one array per field
const keys = Object.keys(items[0]);
const D = {};
for (const k of keys) D[k] = items.map((o) => o[k]);
 
// E: columnar + URL removal combined
const E = {};
for (const k of keys.filter((k) => k !== 'imageUrl' && k !== 'thumbUrl')) E[k] = items.map((o) => o[k]);
 
// Measure raw / gzip(level 6, 9) / Brotli(quality 11) for each
for (const [name, v] of Object.entries({ A: items, B, C, D, E })) {
  const s = JSON.stringify(v);
  console.log(name, {
    raw: Buffer.byteLength(s),
    gz6: zlib.gzipSync(s, { level: 6 }).length,
    gz9: zlib.gzipSync(s, { level: 9 }).length,
    br11: zlib.brotliCompressSync(s, { params: { [zlib.constants.BROTLI_PARAM_QUALITY]: 11 } }).length,
  });
}

gzip level 6 matches the default of most CDNs and reverse proxies. Brotli runs at quality 11, the setting you would use for precompressed static files.

Five Formats, Measured

The results first. Every reduction percentage is relative to baseline A in the same column.

Formatrawgzip(6)gzip(9)Brotli(11)gzip(6) reduction
A baseline (array of objects)7,035,702943,796891,579691,526—
B short keys5,695,702913,189883,867664,434−3.2%
C URLs removed4,185,850745,072704,625559,871−21.1%
D columnar4,695,841691,065648,090556,131−26.8%
E columnar + no URLs2,285,963534,016523,630451,554−43.4%

Notice how the raw reductions and the gzipped reductions refuse to line up. B cuts raw size by 19.0% but ships only 3.2% smaller. C cuts raw by 40.5% yet ships 21.1% smaller. D, meanwhile, cuts raw by 33.3% and keeps most of it — 26.8% — after compression.

The intuition that a smaller file means proportionally lighter delivery simply does not hold once compression sits in the path.

✦

Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
✦Five payload formats measured on a 20,000-item catalog, with a full comparison table for raw, gzip, Brotli, and JSON.parse time
✦Why key-name shortening saves only 3.2% after gzip, while transposing to a columnar layout reaches a 26.8% reduction
✦Splitting into 40 pages costs just 2.9% in size — measured evidence that pagination is nearly free
Secure payment via Stripe · Cancel anytime
✦

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
Share

Thank You for Reading

Rork Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • ✦Copy-paste ready implementation code
  • ✦New advanced guides published daily
  • ✦$5/mo or $10 for lifetime access
View Membership →

Related Articles

◇ App Dev2026-10-28
"Project is incompatible with this version of Expo Go": Three Places to Check Before Blaming Your Project
When Expo Go says your project needs a newer Expo Go, there are three things to compare before you delete node_modules: the project's SDK, the SDK the app supports, and, on Android, a real mix-up in Expo Go 56.0.1. Here is the order I check them in.
◇ App Dev2026-10-22
Expo SDK 58 With Stripe: pod install Stops, and Whether to Turn Off Precompiled Modules or Wait
useFrameworks is already dynamic, yet pod install says Stripe is static and the SDK 58 iOS build stops. The reported conditions, three ways out, and a small script to check your own project first.
◇ App Dev2026-09-18
The three lines I check when prebuild stops on the standard SDK 57 Swift AppDelegate error
Turning on ios.enableSceneSupport for iOS 27 can stop prebuild cold. The cause was not my SDK version but the shape of AppDelegate.swift. Here are the three lines to check, and why copying the SDK 58 migration steps by hand will break your build.