Something went wrong. Try again.
Schedule posts and reposts to Bluesky (and other PDSes) with Cloudflare workers. skyscheduler.work
scheduling social-media cloudflare bsky service cloudflare-workers bsky-tool bluesky
Something went wrong. Try again.
608 B · 14 lines
TypeScript
at main
123456789101112131415import type { BaseContext, NextMiddleware } from "../types";
// Instead of using hono cache, we use CF's worker cache.export async function cachePublicMiddleware(c: BaseContext, next: NextMiddleware) { c.res.headers.set("Cache-Tag", "static"); c.res.headers.set("Cache-Control", "public, max-age=600, stale-while-revalidate=3600"); await next();}
export async function cachePrivateMiddleware(c: BaseContext, next: NextMiddleware) { c.res.headers.set("Cache-Tag", "private"); c.res.headers.set("Cache-Control", "private, max-age=5, stale-while-revalidate=2, must-revalidate"); await next();}