π Failed to add PV to My Website
J.Gong
2025-08-18
0.58min
π Failed to add PV to My Website
Believe it or not, the very first feature on my old Jekyll site in 2015 was a PV (page view) counter π.
But when I rebuilt the site with Gatsby, I thought βeh, too easy, Iβll add it laterβ¦β β and thenβ¦ I just never did π.
A lot of sites use δΈθε for PV counts, but I figured: why not build my own? π€
Turns out, itβs super simple β just two GET requests:
- one returns an image πΌοΈ
- the other returns a JSON with the count π
Now itβs running on Cloudflare Workers + KV, and you can spot the little ποΈ with a number on this site showing the PV count.
If youβre curious, hereβs the health check link β
However, this is me from 20th. As I mentioned, using KV turns out to be a terrible idea π«¨. Only in two days, I used up all my quota π« . Now, I have changed the PV service to goatcounter.