IPFS Gateway Cache control

I’m trying out Cloudflare’s IPFS Gateway connected to my domain. So far everything works like a charm, except I could not find a way to control HTTP cache headers. When accessing my site directly from IPFS gateway with the hash I see the HTTP header cache-control: public, max-age=29030400, immutable. When opening the same site through my domain there’s no cache-control header at all.

What I want to achieve is to have all effectively static assets passed as immutable and cached permanently, but keep a reasonably low cache on index.html and maybe a few other files. Is there something I’m missing? Do I need to move static assets to a subfolder and use a page rule to enforce caching header on it?

Note that I’m using webpack, which appends hashes to file names of generated static assets, so I’m not worried that users will cache them indefinitely, as long as I can exclude index.html.

I’ve actually encountered a similar dilemma in the past without IPFS when hosting on a third party server that wouldn’t let me control http headers.

This topic was automatically closed after 30 days. New replies are no longer allowed.