Skip to content

Commit 8eab7d6

Browse files
committed
minor fixes
1 parent 9add5e7 commit 8eab7d6

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

5-network/06-fetch-api/article.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -215,10 +215,10 @@ window.onunload = function() {
215215

216216
Normally, when a document is unloaded, all associated network requests are aborted. But `keepalive` option tells the browser to perform the request in background, even after it leaves the page. So this option is essential for our request to succeed.
217217

218-
It has few limitations:
218+
It has a few limitations:
219219

220220
- We can't send megabytes: the body limit for `keepalive` requests is 64kb.
221-
- If gather more data, we can send it out regularly in packets, so that there won't be a lot left for the last `onunload` request.
222-
- The limit is for all currently ongoing requests. So we can't cheat it by creating 100 requests, each 64kb.
223-
- We can't handle the server response if the request is made in `onunload`, because the document is already unloaded at that time, functions won't work.
224-
- Usually, the server sends empty response to such requests, so it's not a problem.
221+
- If we need to gather a lot of statistics about the visit, we should send it out regularly in packets, so that there won't be a lot left for the last `onunload` request.
222+
- This limit applies to all `keepalive` requests together. So we can't cheat it by creating 100 requests, each 64kb.
223+
- We can't handle the server response if the document is unloaded. So in our example `fetch` will succeed due to `keepalive`, but subsequent functions won't work.
224+
- In most cases, such as sending out statistics, it's not a problem, as server just accepts the data and usually sends an empty response to such requests.

0 commit comments

Comments
 (0)