Hey JS,
Just making standard fetch request, on version 2025-04.
I think somewhere in the wrapped fetch its setting "cache-control": "no-cache"
I can see this on the API requests, but I’m not setting it and cache is set to default on the fetch requests.
fetch("url", {
"headers": {
"accept": "application/json",
"accept-language": "en-GB,en-US;q=0.9,en;q=0.8",
"authorization": "Bearer X,
"cache-control": "no-cache",
"pragma": "no-cache",
"priority": "u=1, i",
"sec-ch-ua": "\"Chromium\";v=\"136\", \"Android WebView\";v=\"136\", \"Not.A/Brand\";v=\"99\"",
"sec-ch-ua-mobile": "?1",
"sec-ch-ua-platform": "\"Android\"",
"sec-fetch-dest": "empty",
"sec-fetch-mode": "cors",
"sec-fetch-site": "cross-site",
"x-device-id": "e9",
"x-requested-with": "com.shopify.pos"
},
"referrer": "https://extensions.shopifycdn.com/",
"referrerPolicy": "strict-origin-when-cross-origin",
"body": null,
"method": "GET",
"mode": "cors",
"credentials": "include"
});
My response, changed to make it public and max age longer just to try force it
I tried manually overriding the request header, which does work. However even when thats set to allow a cache its still not respected.
You can also see here that the CORS preflight cache isn’t respected as it makes the options request every time, adding time to a customers use of my app for each interaction.