Repository navigation
perf: serve a static share card for people not on DevTrack - #3641
Merged
Merged
Conversation
Scrapers walk the ~1,300 guest profiles linked from the /top boards and fetch each one's share card once, so the CDN never helped: every fetch looked the person up on GitHub, read the whole leaderboard and drew a fresh PNG. On 2026-11-17 one scraper did this every couple of seconds and pushed Active CPU past 15 minutes for the day. Guests now get a redirect to the existing "Not ranked yet" brand card as a static file. Members keep their live card.
|
🎉 Merged! Thanks for contributing to DevTrack. If the project has been useful to you, a ⭐ star on the repo is the easiest way to support it — it helps DevTrack get discovered by more developers. Keep an eye on open issues for your next contribution! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The share card at
/u/<login>/opengraph-imagenow redirects people who aren't on DevTrack to a static copy of the existing Not ranked yet brand card (public/og/devtrack-card.png). Members keep their live rank card.Why
Scrapers walk the ~1,300 guest profiles linked from the
/topboards and fetch each one's share card exactly once, so the CDN cache never got a second hit. Every fetch looked the person up on GitHub, read the whole all-time leaderboard to estimate a rank, and drew a fresh PNG, all billed as Active CPU. On 2026-11-17 a scraper on Facebook's network did this about every two seconds and pushed the day past 15 minutes of the 4-hour monthly Hobby allowance. That network is now blocked in the firewall, but the next scraper would hit the same path.A static file is served by the CDN with no function work. The redirect itself is cached for a day.
Trade-off
A link preview of a non-member's profile shows the generic brand card instead of an estimated rank. Very few people share a non-member's page; members' previews are unchanged. The redirect is temporary (307), so someone who joins gets their own card once the cached redirect expires.
Tests
test/og-user-image-route.test.ts: a guest gets a 307 to the static card with a day of CDN caching; a member still gets a PNG.Deploy note: hold until after the 2026-11-19 Active CPU reading, so the firewall's effect is measured on its own.