I'm trying to get cache headers working for images loaded with custom loader which utilizes the defa
I'm trying to get cache headers working for images loaded with custom loader which utilizes the default Cloudflare Image Optimization implementation. These files are served from the public folder (
I've tried to add the following config settings:
I also tried adding them to
Only way I've been able to get cache headers working for these files is by modifying
Am I missing something or is this the only way to get cache headers working for these images?
public/images) which by default gets no cache (public, max-age=0, must-revalidate) and so the optimizer serves them with this header as well.I've tried to add the following config settings:
I also tried adding them to
_headers file in the root of the project but they don't seem to get included in the final build.Only way I've been able to get cache headers working for these files is by modifying
./.vercel/output/static/_headers after the build by adding this to the end of the generated file:Am I missing something or is this the only way to get cache headers working for these images?