HOLY FUCKING SHIT OMG CLAUDE JUST CRACKED THIS SHIT, THANK YOU @AnthropicAI THANK YOU @DarioAmodei NAMING MY KID AFTER YOU ๐
https://t.co/gObNirRDpS
Added Redis caching to my Go API today and the numbers speak for themselves.
First request (DB): ~5.15ms
Second request (cache): ~845ฮผs
6x faster and that's on localhost. In production with network latency to Postgres, the gap gets wild.
Also implemented role-based access control with level precedence. Admins (level 3) can do what moderators (level 2) can do, but not the other way around. Ownership check runs first and if it's your post, role doesn't matter.
Using go-redis/v9, Argon2 for password hashing, and JSON serialization for the cache layer. 3-day TTL so stale user data doesn't hang around forever.
The course used Redis CLI. I downloaded Redis Insight instead. Being able to see your cached keys, TTLs, and values in a GUI while testing hits different.