axiom-js icon indicating copy to clipboard operation
axiom-js copied to clipboard

Alternative to the cache: no-cache in fetchClient

Open n3oney opened this issue 1 year ago • 3 comments

Hi, 04034e24787cf454cad662f77b9901de9de9cf8c has introduced using the cache: "no-cache" option when making fetch requests. This however, is unsupported by Cloudflare's Workers and Pages, and unfortunately isn't silently ignored, but throws an error. Is it possible to have an option to disable that parameter, or some alternate solution bypassing it?

It currently causes this error: Error: The 'cache' field on 'RequestInitializerDict' is not implemented.

Which is gone by downgrading to 1.0.0-rc.3, which didn't have that commit in.

See https://github.com/cloudflare/workerd/issues/698#issuecomment-2053681304

n3oney avatar Jun 18 '24 23:06 n3oney

Please... our logs have been silently failing due to this for several weeks. Maybe making the fetch function over writable would help with these kind of issues. Bildschirmfoto 2024-06-30 um 09 15 47

bkniffler avatar Jun 30 '24 07:06 bkniffler

Yup same issue here

multiplehats avatar Aug 09 '24 08:08 multiplehats

Have been waiting for Cloudflare to address this issue in https://github.com/cloudflare/workerd/issues/698#issuecomment-2053681304 but there haven't been any updates for a while.

The reason I added this cache parameter is to prevent frameworks like Next.js from caching the requests. Will have to think about a different solution

thesollyz avatar Aug 09 '24 11:08 thesollyz

Seems like https://github.com/axiomhq/axiom-js/pull/249 probably fixed this?

SlexAxton avatar Jan 29 '25 17:01 SlexAxton

yes, version 1.3.1 was shipped with no-store.

thesollyz avatar Jan 30 '25 08:01 thesollyz