HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
1cg
html-json-size-comparison
HTML2024–2025
1cg / html-json-size-comparison

html-json-size-comparison

Discover this repository through its Hacker News conversations.

3Distinct people
5Mentions
0Explicit recommenders
27GitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

A public description has not been verified.

Where it is used

No documented product use has been verified yet.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 3:56:07 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by week5 dated mentions

Observed mentions: 2024-06-20 12:59:16 UTC to 2025-01-24 15:38:00 UTC. Weeks start Monday, UTC.

012024-06-17 00:00:00 UTC to 2024-06-24 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 commentsJun 172024-06-24 00:00:00 UTC to 2024-07-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-07-01 00:00:00 UTC to 2024-07-08 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-07-08 00:00:00 UTC to 2024-07-15 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-07-15 00:00:00 UTC to 2024-07-22 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-07-22 00:00:00 UTC to 2024-07-29 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-07-29 00:00:00 UTC to 2024-08-05 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-08-05 00:00:00 UTC to 2024-08-12 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-08-12 00:00:00 UTC to 2024-08-19 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-08-19 00:00:00 UTC to 2024-08-26 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-08-26 00:00:00 UTC to 2024-09-02 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-09-02 00:00:00 UTC to 2024-09-09 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-09-09 00:00:00 UTC to 2024-09-16 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-09-16 00:00:00 UTC to 2024-09-23 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-09-23 00:00:00 UTC to 2024-09-30 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-09-30 00:00:00 UTC to 2024-10-07 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 commentsSep 302024-10-07 00:00:00 UTC to 2024-10-14 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-10-14 00:00:00 UTC to 2024-10-21 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-10-21 00:00:00 UTC to 2024-10-28 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-10-28 00:00:00 UTC to 2024-11-04 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-11-04 00:00:00 UTC to 2024-11-11 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-11-11 00:00:00 UTC to 2024-11-18 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-11-18 00:00:00 UTC to 2024-11-25 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-11-25 00:00:00 UTC to 2024-12-02 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-12-02 00:00:00 UTC to 2024-12-09 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2024-12-09 00:00:00 UTC to 2024-12-16 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2024-12-16 00:00:00 UTC to 2024-12-23 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-12-23 00:00:00 UTC to 2024-12-30 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-12-30 00:00:00 UTC to 2025-01-06 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2025-01-06 00:00:00 UTC to 2025-01-13 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2025-01-13 00:00:00 UTC to 2025-01-20 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2025-01-20 00:00:00 UTC to 2025-01-27 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 commentsJan 20

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
Jun 172024-06-17 00:00:00 UTC2024-06-24 00:00:00 UTC101
Jun 242024-06-24 00:00:00 UTC2024-07-01 00:00:00 UTC000
Jul 12024-07-01 00:00:00 UTC2024-07-08 00:00:00 UTC000
Jul 82024-07-08 00:00:00 UTC2024-07-15 00:00:00 UTC000
Jul 152024-07-15 00:00:00 UTC2024-07-22 00:00:00 UTC000
Jul 222024-07-22 00:00:00 UTC2024-07-29 00:00:00 UTC000
Jul 292024-07-29 00:00:00 UTC2024-08-05 00:00:00 UTC000
Aug 52024-08-05 00:00:00 UTC2024-08-12 00:00:00 UTC000
Aug 122024-08-12 00:00:00 UTC2024-08-19 00:00:00 UTC000
Aug 192024-08-19 00:00:00 UTC2024-08-26 00:00:00 UTC000
Aug 262024-08-26 00:00:00 UTC2024-09-02 00:00:00 UTC000
Sep 22024-09-02 00:00:00 UTC2024-09-09 00:00:00 UTC000
Sep 92024-09-09 00:00:00 UTC2024-09-16 00:00:00 UTC000
Sep 162024-09-16 00:00:00 UTC2024-09-23 00:00:00 UTC000
Sep 232024-09-23 00:00:00 UTC2024-09-30 00:00:00 UTC000
Sep 302024-09-30 00:00:00 UTC2024-10-07 00:00:00 UTC000
Oct 72024-10-07 00:00:00 UTC2024-10-14 00:00:00 UTC000
Oct 142024-10-14 00:00:00 UTC2024-10-21 00:00:00 UTC000
Oct 212024-10-21 00:00:00 UTC2024-10-28 00:00:00 UTC000
Oct 282024-10-28 00:00:00 UTC2024-11-04 00:00:00 UTC000
Nov 42024-11-04 00:00:00 UTC2024-11-11 00:00:00 UTC000
Nov 112024-11-11 00:00:00 UTC2024-11-18 00:00:00 UTC000
Nov 182024-11-18 00:00:00 UTC2024-11-25 00:00:00 UTC000
Nov 252024-11-25 00:00:00 UTC2024-12-02 00:00:00 UTC000
Dec 22024-12-02 00:00:00 UTC2024-12-09 00:00:00 UTC101
Dec 92024-12-09 00:00:00 UTC2024-12-16 00:00:00 UTC101
Dec 162024-12-16 00:00:00 UTC2024-12-23 00:00:00 UTC000
Dec 232024-12-23 00:00:00 UTC2024-12-30 00:00:00 UTC000
Dec 302024-12-30 00:00:00 UTC2025-01-06 00:00:00 UTC000
Jan 62025-01-06 00:00:00 UTC2025-01-13 00:00:00 UTC101
Jan 132025-01-13 00:00:00 UTC2025-01-20 00:00:00 UTC000
Jan 202025-01-20 00:00:00 UTC2025-01-27 00:00:00 UTC101

What Hacker News says

5 sources
I find this no-nonsense approach very appealing. > The more you render from the server, the larger your caches end up. Not doing that for HTML. Is HTML really that much larger or complex than JSON? Based on the following it seems to be only +10-15% larger (n = 1 dataset obviously). https://github.com/1cg/html-json-size-comparison Is the amount of data transfer the main reason to use JSON or do you find Web Components play better with JSON payloads? I could imagine the template string being rendered on the server, fetch()-ed by the client and swapped with this.innerHTML. Do you manage any amount of cross-component state? It's one use case where JSON would win over "HTML over the wire".
In Moving on from React, a year later
Yeah, that was too short a response, sorry I was bouncing around a lot in the thread. The essay I linked to somewhat agrees w/your general point, which is that hypermedia is (mostly) wasted on automated consumers of REST (in the original sense) APIs. I don't think it's a bad thing to split your hypermedia API and your JSON API: https://htmx.org/essays/splitting-your-apis/ (NB, some people recommend even splitting your JSON-for-app & JSON-for-integration APIs: https://max.engineer/server-informed-ui) I also don't think it's hard to avoid duplicating your effort, assuming you have a decent model layer: https://htmx.org/essays/mvc/ As far as efficiency goes, HTML is typically within spitting distance of JSON particularly if you have compression enabled: https://github.com/1cg/html-json-size-comparison And is also may be more efficient to gen
Read the rest
erate because it isn't using reflection: https://github.com/1cg/html-json-speed-comparison (Those costs will typically be dwarfed by data store access anyway) So, all in all, I kind of agree with you on the pointlessness of REST purity when it comes to general purpose APIs, but disagree in that I think you can profitably split your application API (hypermedia) from your automation API (JSON) and get the best of both worlds, and not duplicate code too much if you have a proper model layer. Hope that's more useful.
In Triptych Proposals
ceteris is rarely paribus: JSON-based APIs have to make a choice between being general purpose, in which case a web app written against them may end up chatty with multiple requests per page, or they end up application specific, in which case they can be churney and a bad general purpose API. I wrote an essay about this here: https://htmx.org/essays/splitting-your-apis/ Also, producing JSON often involves reflection and can be more CPU intensive than straight templating (w/ fixed properly lookups) depending on your technology. Finally, the size delta between JSON and hypermedia is lower than most people think, particularly with compression: https://github.com/1cg/html-json-size-comparison in most real world systems i expect data store access to be the dominant latency issue some people have had good success w/htmx from a performance pers
Read the rest
pective (2x+ speed, 1/2 memory consumption): https://htmx.org/essays/a-real-world-react-to-htmx-port/ but of course it depends on your use case. I think htmx would be excellent for an e-commerce site, which is mostly text and images and relatively simple, coarse-grained user interactions.
In React 19

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.