3 ms·
Show HN: CloudCounter – Serverless GoatCounter on Cloudflare Pages and D1
- bsenescu 9mo agoThis is awesome. What were the hardest parts of porting it to Cloudflare?
- 7777777phil 9mo agoThanks! Hardest part was redesigning the data model.. GoatCounter does complex aggregations at query time, but D1's 10ms CPU limit means you have to pre-aggregate everything (hourly rollups, per-dimension stats tables). Session dedup was tricky too since Workers are stateless so I ended up using KV with IP+UA hash and 8hr TTL. The other annoyance is Pages doesn't support cron, so daily cleanup needs a separate Worker. Still some way to go implementing Zero Trust auth etc..
- deleted 9mo ago[deleted]