The secret life of this number

  1. Your browser checks its notes. Is site:visit-counted in localStorage? Then you're already in.

  2. First time? One letter. POST /api/visits. After that, only GET, which just reads the number.

  3. A tiny function wakes up. A Cloudflare Pages Function takes the request.

  4. D1 does the maths. count = count + 1, in one row of SQLite.

No cookies, no IP, no ID. A new browser counts as a new visitor, so this is a friendly estimate.

Blogs

Notes on frontend engineering, the browser, and the backend behind it.

No posts yet.