Skip to content

[FEATURE] Deduplicate requests #18

@amannn

Description

@amannn

What / Why

Currently when you request the same URL two times immediately, both hit the network and will resolve with their respective response afterwards.

This happens because the cache manager is only consulted at these two stages:

  1. Before a request is fired off, the cache manager is asked if there is already a response.
  2. After a request is finished, the response will be put inside the cache.

I think it would be helpful if there would be a lookup if a request is already in flight, and if so, return the promise of that request instead of making the same request again.

Note that this should only be the case for idempotent calls – mostly GET. PUT could also work, but the request body needs to be part of the cache identifier then.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions