Skip to content

Questions About SSE and Fetch Behavior in Datastar #303

Closed Answered by bencroker
surfskidude asked this question in Q&A
Discussion options

You must be logged in to vote

Does the Datastar server-side open a new persistent SSE connection for each Fetch call initiated from the client? If so, what happens to any existing SSE connections? Are they closed, or do they remain active until explicitly terminated?

The Datastar library is frontend only. Each fetch results in an SSE connection. Whether the connection is persistent or not depends entirely on the backend implementation.

Client-to-Server Fetch Requests: How are client-to-server Fetch requests handled? The examples include various URLs. Should I interpret this as a REST API design, even though the server responds with SSE streams?

They are fetch requests to the URL of your choosing. The backend API i…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@surfskidude
Comment options

@bencroker
Comment options

Answer selected by bencroker
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants