How do I set custom headers with Elysia
I am using Elysia with CloudflareAdapter to render pages. In the build I generate:
/out/_worker.js (server and tsx)
/out/static (images, css, js)
This is my wrangler.json:
From what I understand from the docs (https://elysiajs.com/integrations/cloudflare-worker), requests for static assets dont go through the worker, so I should use a _headers file in file instead of a middleware:
The problem is that even with this file, the headers remain the same.

2 Replies
Feedback
Feedback has been submitted! Thank you :)
Solved, i needed to put it in out/static/ and change the file to:
/assets/*
Cache-Control: public, max-age=31536000, immutable