A fast, modern, and cache-friendly Gravatar CDN proxy — built with Cloudflare Workers and Hono.
Supports:
- MD5 / SHA-256 hash or raw email lookups
- Smart caching (Edge + Browser)
- Auto image format conversion to AVIF or WebP based on
Accept
header
Fetches the maintainer's Gravatar avatar with no params needed.
Example:
GET /avatar/me
Fetches the Gravatar avatar via precomputed MD5 or SHA-256 hash.
Example:
GET /avatar/205e460b479e2e5b48aec07710c08d50?s=128
Fetches the avatar by raw email (safely hashed server-side).
Example:
GET /[email protected]&size=256
Param | Description | Default |
---|---|---|
s or size |
Image size in pixels (square, e.g. 128x128) | 200 |
d or default |
Default fall back option (e.g. a URL, or 404) | 404 |
Automatically returns the most optimized format:
image/avif
(if supported)image/webp
(fallback)- Original JPEG (fallback fallback 🙃)
Based on the browser’s Accept
header:
Accept: image/avif,image/webp,image/*,*/*
Response | Browser TTL | Edge TTL | Notes |
---|---|---|---|
200 OK |
1 day | 30 days | stale-while-revalidate enabled |
404 |
5 minutes | 1 hour | Allows retry for new users |
Built-in Cloudflare CDN handles global delivery and bandwidth optimization.
- Cloudflare Workers – fast and global by design
- Hono – lightweight routing framework (also Hono JSX for API doc)
- @jsquash – AVIF/WebP encoding via WASM
- TypeScript – strong typing, strict mode
- Pure CSS – custom theme 💮
This project is licensed under the MIT License.