Skip to content

Cache sponsor artwork, and let the empty slots be bought - #40

Merged
lbesecker195 merged 1 commit into
mainfrom
fix/sponsor-images-cache-and-enquiry
Sep 19, 2026
Merged

lbesecker195 merged 1 commit into
mainfrom
fix/sponsor-images-cache-and-enquiry

Conversation

@lbesecker195

Copy link
Copy Markdown
Owner

Closes #39.

Why they were slow

Measured from production:

file bytes total
Book.png 689 KB 2.02s
sponsor-1.png 370 KB 2.65s
sponsor-2.png 489 KB 7.59s
sponsor-3.png 289 KB 1.38s

1.79 MB, at 64–340 KB/s. Three causes:

  1. No usable cache lifetime — my defect. The markup referenced the files as plain strings, and Plug.Static only answers with cache-control: public, max-age=31536000, immutable for a request carrying the asset digest. A bare path gets a bare cache-control: public and no Last-Modified, so browsers fall back to heuristic caching and revalidate or refetch. Confirmed against production: /images/Book.pngcache-control: public; /images/Book.png?vsn=dmax-age=31536000, immutable. Fixed here.
  2. They are 4× larger than they render. 1000×1000 PNGs displayed at 250px (350px hovered). Even at 2× DPR, ~500px would do — roughly 90% of those bytes are wasted. Not fixed here; it means re-exporting the artwork.
  3. No CDN. Every byte comes from the single origin, which also explains the 64 KB/s tail.

Also in here

The three unsold slots were not links at all. They now open a pre-filled enquiry:

mailto:me@loganbesecker.com
  ?subject=Interested Sponsor for MCP Harbor
  &body=I'm interested in bidding $____ for a Sponsor position on MCP Harbor.

Built with rfc3986 encoding rather than URI.encode_www_form/1, which writes a space as + — mail clients paste that into the subject line literally. A "make an offer" line sits under the block for anyone who does not think to click the artwork.

rel="sponsored" stays on the paid placement only; it describes paid outbound links and means nothing on a mailto.

87 tests pass, including one that pins the mailto encoding and one that pins the artwork going through the static path helper.


Pages affected:

🤖 Generated with Claude Code

The four images total 1.79MB and were refetched on every visit. Plug.Static
only answers with a year-long immutable lifetime for a request carrying the
asset digest, and the markup referenced the files as plain strings, so they
came back with a bare cache-control: public.

- Address the artwork through the static path helper, so the digest is present
  and a repeat visit spends nothing on it
- Point the three unsold slots at a pre-filled enquiry email rather than
  leaving them inert, and add a "make an offer" line under the block
- Build the mailto with rfc3986 encoding, because encode_www_form writes a
  space as "+" and mail clients paste that into the subject literally
- Keep rel="sponsored" on the paid placement only; it describes paid outbound
  links and means nothing on a mailto

This does not shrink the files. They are 1000x1000 and render at 250px, so
about 90% of those bytes are still wasted.

---

Pages affected:

- [MCP Registry](https://ai.mcpharbor.dev/) — home page of the MCP server directory.
- [GitHub MCP server](https://ai.mcpharbor.dev/servers/io.github.github/github-mcp-server) — a detail page carrying the sponsored slots.
- [Browse MCP servers](https://ai.mcpharbor.dev/servers) — the searchable catalogue.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@lbesecker195
lbesecker195 merged commit 93ebc07 into main Sep 19, 2026
@lbesecker195
lbesecker195 deleted the fix/sponsor-images-cache-and-enquiry branch September 19, 2026 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sponsor artwork is uncacheable, and unsold slots go nowhere

1 participant