Trim Voicy message stats and gzip JSON responses #65
No reviewers
Labels
No labels
bug
dependencies
documentation
duplicate
enhancement
good first issue
help wanted
invalid
javascript
question
symphony
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
backmeupplz/borodutch-stats!65
Loading…
Reference in a new issue
No description provided.
Delete branch "trim-and-gzip-stats"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Makes the borodutch.com stats requests much smaller.
/stats/voicywas 580 KB. 489 KB of that wasmessageStatscarrying whole Mongo documents (_id,createdAt,updatedAt,__v). It now keeps only{ date, count }, the only fields the site charts.Accept-Encoding: gzip, using a ~15-line middleware on Node'szlibwith no new dependency. Before this, every endpoint was served uncompressed:/count55 KB,/stats/banofbot257 KB,/stats/todorant125 KB.Checks:
yarn build-ts, andjestpasses 92/92. Ran it locally:/summarycomes back gzipped withVary: Accept-Encodingwhen asked, and as plain JSON otherwise.Note: the service has to be redeployed on Easypanel to take effect.
🤖 Generated with Claude Code