Reputation: 1480
When running a fetch request on one domain (i.e. example.com
), which requests a resource on another domain (i.e. example.net
) through fetch, i.e.
// Code that gets executeed by i.e. example.com/index.js
const resp = await fetch("https://example.net/my-resource?id=42", { cache: "default" });
Given that the other domain is correctly configured to:
OPTIONS
and all sends all needed "allow cross-origin" headers)Cache-Control: max-age=10000
)Does the browser cache that response, so that subsequent fetch requests to the same resource URL will use the local cache?
Additional question: If this is the case, how is it possible to debug that with the browser's dev tools? Seems like CORS fetch requests don't display Headers/Request/Response details on the Network tab at least in Firefox, and no cache updates for the other domain appear in the "storage" tab (I assume they might just be filtered to only display the current origin's cache).
Upvotes: -1
Views: 24