···11+# cdn.blueat.net Worker (AT Protocol Image CDN)
22+33+Cloudflare Worker that acts as a drop-in style replacement for Bluesky image CDN endpoints by proxying image blobs directly from a user's Personal Data Server (PDS). It resolves the PDS endpoint from the DID (supports `did:web:` and `did:plc:`) and then fetches the requested blob.
44+55+## Quick deploy (to your own Cloudflare account)
66+77+1. Install Node.js (LTS).
88+2. From this folder, run:
99+ - `npm install`
1010+ - `npm run deploy`
1111+3. If prompted, run `wrangler login` (Wrangler stores your auth token locally).
1212+1313+The included `wrangler.toml` deploys with `workers_dev = true` (so it will be reachable under your Worker subdomain). To serve the real domain (`cdn.blueat.net`), update `wrangler.toml` with your `route` and `zone_id`.
1414+1515+## Configuration
1616+1717+In `wrangler.toml`, you can change:
1818+1919+- `PLC_DIRECTORY`: base URL used to resolve `did:plc:` to a PLC document.
2020+- `CACHE_MAX_AGE_SECONDS`: value used for the `Cache-Control: s-maxage=...` header.
2121+2222+## Local development
2323+2424+- `npm run dev`
2525+2626+## Request format
2727+2828+This worker expects paths like:
2929+3030+`/img/{type}/plain/{did}/{cid}`
3131+3232+Where `{type}` is typically `avatar` or `banner`. Example:
3333+3434+`/img/avatar/plain/did:plc:exampleCid/ExampleImageCid`
3535+3636+## Notes
3737+3838+- Results are cached via `caches.default` and also include `Cache-Control` for downstream caching.
3939+- If the requested `avatar`/`banner` CID is missing, the worker tries to find the current CID from the profile record and retries once.
4040+