Response caching
Answer with Cache-Control: public, max-age=60 and repeat requests are served from cache without running your code.
Response caching, static files and whole static sites for your edge functions, with cache headers you control and purges from the CLI.
// lyrcloud.json: "assets": "public"
export default {
async fetch(request) {
const data = await expensiveLookup();
return Response.json(data, {
headers: { 'cache-control': 'public, max-age=300' },
});
},
};
// $ lyrcloud cache purge --prefix /blog
Answer with Cache-Control: public, max-age=60 and repeat requests are served from cache without running your code.
"assets": "public" serves a folder with content types, ETags and clean URLs. A project can be just a static site.
Set "spa": true and unknown routes get index.html.
lyrcloud cache purge clears everything, one path or a prefix. Every deploy starts with a fresh cache.
Private, cookie-setting, signed-in and Access-protected responses are never cached. x-lyr-cache shows HIT, MISS or BYPASS.
Coming soon.
Register or transfer a domain with free WHOIS privacy and Lyrcloud DNS, paid by card or with Lyrpay.
Learn moreRate limits, IP rules, a firewall for common attacks, bot checks and secure headers for your edge functions, set in lyrcloud.json and enforced before your code runs.
Learn moreDeploy JavaScript fetch handlers from the lyrcloud CLI. Each function runs in its own isolated sandbox and goes live at https://<name>.dev.lyr.
Learn moreCreate a free account in under a minute. No credit card required.