RORK LABJP
NATIVE — Rork Max reaches AR and LiDAR scanning, Metal-backed 3D, Dynamic Island, Siri Intents, HealthKit, NFC, App Clips, and on-device Core MLIOS27 — iOS 27 Developer Beta 4 extends Siri AI to iPhone 15 Pro and 15 Pro Max plus the 16 and 17 lines, with noticeably faster responses than the first betaDESIGN — Apple's own design kits for iOS, iPadOS, and macOS 27 are now available for Figma and Sketch, ready for when you lay out UI for the new OSCANARY — Android 17, codenamed Cinnamon Bun, retires Developer Previews in favor of continuously updated Canary builds, which changes when you schedule testingSPARK — Gemini Spark in Android 17 drives apps directly to automate multi-step errands like booking a ride or placing an orderSCALE — Rork raised $2.8M from a16z and now draws roughly 743,000 visits a monthNATIVE — Rork Max reaches AR and LiDAR scanning, Metal-backed 3D, Dynamic Island, Siri Intents, HealthKit, NFC, App Clips, and on-device Core MLIOS27 — iOS 27 Developer Beta 4 extends Siri AI to iPhone 15 Pro and 15 Pro Max plus the 16 and 17 lines, with noticeably faster responses than the first betaDESIGN — Apple's own design kits for iOS, iPadOS, and macOS 27 are now available for Figma and Sketch, ready for when you lay out UI for the new OSCANARY — Android 17, codenamed Cinnamon Bun, retires Developer Previews in favor of continuously updated Canary builds, which changes when you schedule testingSPARK — Gemini Spark in Android 17 drives apps directly to automate multi-step errands like booking a ride or placing an orderSCALE — Rork raised $2.8M from a16z and now draws roughly 743,000 visits a month
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.

Rork526Expo157JSON2gzipperformance11

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-07-16
Placing Native Ads in a Masonry Wallpaper Grid: Designing the Lifetime of an Ad Cell
One native ad in a masonry gallery pushed memory from 180 MB to 420 MB over twenty minutes of scrolling. Here is why cell recycling and ad object lifetime never line up, the pool-based implementation that fixed it, and how I picked the insertion interval from measured numbers.
App Dev2026-07-14
Long-Press Context Menus for a Gallery Item in a Rork Expo App
Long-pressing a wallpaper card does nothing, yet iOS users expect a preview and a menu. From why Pressable alone falls short, to a native context menu with zeego, resolving the scroll-vs-long-press conflict, wiring up save and share, and a custom overlay fallback for Android — all with working code.
App Dev2026-07-07
Laying Out Variable-Height Images in Two Columns: A Masonry Wallpaper Gallery in a Rork Expo App
From why numColumns cannot pack variable-aspect images cleanly, to a dependency-free column-balancing algorithm, to keeping virtualization with FlashList masonry and a pragmatic no-dependency fallback, building a wallpaper gallery with real code.
📚RECOMMENDED BOOKS
Build a Large Language Model (From Scratch)
Sebastian Raschka
LLM Dev
Prompt Engineering for LLMs
Berryman & Ziegler
Prompting
AI Engineering
Chip Huyen
AI Eng
* Contains affiliate links
See all →