Hacker News new | ask | show | jobs
by jchook 27 days ago
The site is really fast. I see HTTP/3, OpenGraph, and Cloudflare. Can you expand on the technologies used?

Also... "Each book links back to the comments that mentioned it."

> Please don't put generated text in HN posts.

Claude speak gives me a gag reflex these days.

5 comments

talk about speed! I have never seen anything with useful content load that fast. Very curious on what went into making it.
Local search index is the key to responsiveness.
Where does hacker books and hackertube get the data from? Is there a regular dump somewhere? Scraped, api?
For https://hngram.com/ I pull it from the HuggingFace parquet dataset https://huggingface.co/datasets/open-index/hacker-news
I believe there’s a hackernews dump on google big query public datasets.
Also Hacker news does have a public API. It's ugly and awkward and they're never going to improve it but it's also free and not rate limited.
It does load faster than Hacker News itself here…
Ow it doesnt load anymore
Thanks! First version was clunky, and hot-linked all cover images. Right now its plain JS and static JSON files, hosted on Cloudflare. First load pulls a ~30kb index of the top books, the full 16k list loads in the background, and everything has hashed filenames so it's cached forever. Covers are on R2. The data pipeline is python + duckdb over the HN dump.

And fair on the post, I had claude draft it and only edited it a couple of times. Should have just written it myself.

I wonder if plain JS will make a comeback with how good AIs are at writing code (at least for one off simple sites)
i'm on a performance grind rn so also looked into it. claudeslop disclaimer below:

Hacker Books painted in 0.48 seconds on a fresh mobile visit. The first book cards were in the DOM by 0.79 seconds, and the largest visible image painted at 1.52 seconds. On a repeat visit, that image painted in 0.21 seconds.

Homepage median Fresh browser cache Repeat visit

First byte 112 ms 86 ms

First contentful paint 480 ms 168 ms

First book cards inserted 793 ms 188 ms

Largest contentful paint 1,520 ms 212 ms

Three runs per condition in Chrome at 390 × 844, with 1.6 Mbps download, 120 ms emulated latency and 4× CPU slowdown. These are navigation-start lab timings from one location. All three fresh visits beat your 1.5-second FCP target. Hacker Books

What makes it feel fast

- The first screen needs very little code. The HTML is about 3 KB, its single blocking stylesheet 5 KB, and its vanilla JavaScript module 26 KB, all gzip-compressed. The HTML contains the header, search box and navigation, so those can paint before the catalog arrives. There’s no React runtime to download or hydrate.

- They publish a small answer to the first query. The homepage preloads a 33 KB index of the top 600 books alongside the app code. The full 692 KB index of 15,362 books loads in the background. Once it arrives, browsing and search can reuse it locally. Covers are 320 px WebPs, and additional cards render in batches as you scroll.

- A book click can show the title immediately. The app changes the URL hash, renders the book information already in memory, then fills in comments and related material from a per-book JSON file. Hovering or focusing a card for 80 ms starts that fetch early. Repeat visits reuse the result. This is targeted data prefetching; it costs much less than prerendering an entire destination.

- Cloudflare helps on both visits. My HTML request was a cache HIT at Cloudflare’s San Jose edge. The versioned CSS, JS and index files advertise a one-year immutable browser cache. Chrome recorded zero transfer bytes for those files on all three repeat visits. HTTP/3 was real, too: two fresh visits negotiated H3 and one negotiated H2. All three painted within 468–500 ms, so the site was fast on either protocol in this sample.

- Open Graph handles sharing. The title, description and URL tags describe the site to link-preview crawlers. They don’t accelerate rendering. The page also includes Cloudflare Web Analytics.