Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Feature Request: Batching GET request in a single microtask (javascript frontend API) #7395

@petermakeswebsites

Description

@petermakeswebsites

Inspiration being drawn from Svelte's query batching, where multiple queries that are triggered within the same microtask are batched to be one single API call. The backend parses each query individually but wraps the result in one response. Behind the scenes the JS API receives the response and splits it, delivering each result to its appropriate promise and returning it to its appropriate function.

This basically means that if your frontend does a several API calls at one instant but in different parts of the app (e.g. during initial load), rather than sending 5 http requests right away, each call is "glued", send as one http request, parsed individually in pocketbase, and returned as one. But from the perspective of the frontend the experience is seamless, because each of 5 queries receive an individual resolution corresponding to their query.

At scale I'm sure this can help be quite impactful for performance and efficiency.

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