Skip to content

Commit

Permalink
[doc] Housekeeping
Browse files Browse the repository at this point in the history
  • Loading branch information
ptaoussanis committed Nov 3, 2023
1 parent 5c1ff16 commit 1a1e3ca
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions wiki/1-Getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,10 @@ client event-msg | `{:keys [event id ?data send-fn]}`

I recommend **not** using Sente to transfer large payloads (> 1MB).

The reason is that Sente will by default operate over a WebSocket when possible. This is great for realtime bidirectional communications, but it does mean that there's a bottleneck on that socket.
The reason is that Sente will by default operate over a WebSocket when possible. This is great for realtime bidirectional communications, but:

1. WebSockets aren't ideal for large data transfers, and
2. You'll have a bottleneck on that socket

If a WebSocket connection is saturated dealing with a large transfer, other communications (e.g. notifications) won't be able to get through until the large transfer completes.

Expand All @@ -198,7 +201,7 @@ Instead, I recommend using Sente **only for small payloads** (<= 1MB) and for **

(Sente includes a [util](https://taoensso.github.io/sente/taoensso.sente.cljs.html#var-ajax-lite) to make Ajax requests very easy).

This way you're using the ideal tools for each job:
This way you're using the ideal tool for each job:

- Sente's realtime socket is reserved for realtime purposes
- Dedicated Ajax requests are used for large transfers, and have access to normal browser HTTP caching, etc.
Expand Down

0 comments on commit 1a1e3ca

Please sign in to comment.