-
-
Notifications
You must be signed in to change notification settings - Fork 643
Description
In the current implementation of the matrix-js-sdk, setting the cache
property of fetch()
to no-cache
(-> Cache-Control: max-age=0
) prevents browsers from caching preflight (OPTIONS) requests. This behavior leads to unnecessary network overhead, as preflight requests are sent before every cross-origin request, even when the CORS policy remains unchanged.
https://github.com/matrix-org/matrix-js-sdk/blob/develop/src/http-api/fetch.ts#L294
The older implementation from 3 years ago doesn't seem to specify any cache-control directive on requests:
https://github.com/matrix-org/matrix-js-sdk/blob/e37aab29672256218d30876e96dd17fedc0506f7/src/http-api.ts
I'm not saying the new behavior is incorrect, but it's worth raising the issue and perhaps discuss it, as it has performance implications.
