This is just a stub doc for collecting any SSE related tips/tricks/considerations others in the Datastar community want to share. While it will likely serve as a helpful resource itself, the content will be used to author a more user friendly doc or artifact to reference when learning and leveraging SSE.
There are some known gotchas for SSE documented here:
Here are a few things I've picked up along the way by using SSE that may help others:
100s:1), if your response is well suited to it (ie the structure of your HTML is fairly similar across events and the SSE stream is long-lasting). This can result in barely any data transfer to the client over the lifetime of the connection.Cache-controlheader. Compression is basically the way you can cache, but it is scoped per connection.data: elementsprefix, for example, will break the event parsing and result in no DOM update at all. The SDKs handle this for you automatically.