• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1DEPENDENCY BASED PRIORITY
2-------------------------
3
4nghttp sends priority hints to server by default unless
5:option:`--no-dep` is used.  nghttp mimics the way Firefox employs to
6manages dependency using idle streams.  We follows the behaviour of
7Firefox Nightly as of April, 2015, and nghttp's behaviour is very
8static and could be different from Firefox in detail.  But reproducing
9the same behaviour of Firefox is not our goal.  The goal is provide
10the easy way to test out the dependency priority in server
11implementation.
12
13When connection is established, nghttp sends 5 PRIORITY frames to idle
14streams 3, 5, 7, 9 and 11 to create "anchor" nodes in dependency
15tree:
16
17.. code-block:: text
18
19                      +-----+
20                      |id=0 |
21                      +-----+
22                     ^   ^   ^
23              w=201 /    |    \ w=1
24                   /     |     \
25                  / w=101|      \
26              +-----+ +-----+ +-----+
27              |id=3 | |id=5 | |id=7 |
28              +-----+ +-----+ +-----+
29                 ^               ^
30             w=1 |           w=1 |
31                 |               |
32              +-----+         +-----+
33              |id=11|         |id=9 |
34              +-----+         +-----+
35
36In the above figure, ``id`` means stream ID, and ``w`` means weight.
37The stream 0 is non-existence stream, and forms the root of the tree.
38The stream 7 and 9 are not used for now.
39
40The URIs given in the command-line depend on stream 11 with the weight
41given in :option:`-p` option, which defaults to 16.
42
43If :option:`-a` option is used, nghttp parses the resource pointed by
44URI given in command-line as html, and extracts resource links from
45it.  When requesting those resources, nghttp uses dependency according
46to its resource type.
47
48For CSS, and Javascript files inside "head" element, they depend on
49stream 3 with the weight 2.  The Javascript files outside "head"
50element depend on stream 5 with the weight 2.  The mages depend on
51stream 11 with the weight 12.  The other resources (e.g., icon) depend
52on stream 11 with the weight 2.
53
54SEE ALSO
55--------
56
57:manpage:`nghttpd(1)`, :manpage:`nghttpx(1)`, :manpage:`h2load(1)`
58