diff options
author | Filipa Lacerda <filipa@gitlab.com> | 2017-03-17 15:08:06 +0000 |
---|---|---|
committer | Jacob Schatz <jschatz@gitlab.com> | 2017-03-17 15:08:06 +0000 |
commit | 2e1b9999f950b1d29bc1de901d57feb3a66ff67f (patch) | |
tree | 3f5fa6472df8a66c1b5da6a7b27829c8abe52488 /doc/development | |
parent | 4c2ea7d02d0dce1d92b3fca81fce8312afa0edc7 (diff) | |
download | gitlab-ce-2e1b9999f950b1d29bc1de901d57feb3a66ff67f.tar.gz |
Updates realtime documentation for the Frontend
Diffstat (limited to 'doc/development')
-rw-r--r-- | doc/development/frontend.md | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/doc/development/frontend.md b/doc/development/frontend.md index 766b5f1f477..50105a486d0 100644 --- a/doc/development/frontend.md +++ b/doc/development/frontend.md @@ -36,16 +36,23 @@ You can find documentation about the desired architecture for a new feature buil When writing code for realtime features we have to keep a couple of things in mind: 1. Do not overload the server with requests. -1. It should feel realtime. +1. It should feel realtime. -Thus, we must strike a balance between sending requests and the feeling of realtime. Use the following rules when creating realtime solutions. +Thus, we must strike a balance between sending requests and the feeling of realtime. +Use the following rules when creating realtime solutions. -1. The server will tell you how much to poll by sending `X-Poll-Interval` in the header. Use that as your polling interval. This way it is easy for system administrators to change the polling rate. A `X-Poll-Interval: -1` means you should disable polling, and this must be implemented. -1. A response of `HTTP 429 Too Many Requests`, should disable polling as well. This must also be implemented. +1. The server will tell you how much to poll by sending `Poll-Interval` in the header. +Use that as your polling interval. This way it is easy for system administrators to change the +polling rate. +A `Poll-Interval: -1` means you should disable polling, and this must be implemented. +1. A response with HTTP status `4XX` or `5XX` should disable polling as well. 1. Use a common library for polling. -1. Poll on active tabs only. Use a common library to find out which tab currently has eyes on it. Please use [Focus](https://gitlab.com/andrewn/focus). Specifically [Eyeballs Detector](https://gitlab.com/andrewn/focus/blob/master/lib/eyeballs-detector.js). -1. Use regular polling intervals, do not use backoff polling, or jitter, as the interval will be controlled by the server. -1. The backend code will most likely be using etags. You do not and should not check for status `304 Not Modified`. The browser will transform it for you. +1. Poll on active tabs only. Use a common library to find out which tab currently has eyes on it. +Please use [Focus](https://gitlab.com/andrewn/focus). Specifically [Eyeballs Detector](https://gitlab.com/andrewn/focus/blob/master/lib/eyeballs-detector.js). +1. Use regular polling intervals, do not use backoff polling, or jitter, as the interval will be +controlled by the server. +1. The backend code will most likely be using etags. You do not and should not check for status +`304 Not Modified`. The browser will transform it for you. ### Vue |