Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pmeenan/http2priorities
Test Page for HTTP/2 prioritization (server and browser)
https://github.com/pmeenan/http2priorities
Last synced: 3 months ago
JSON representation
Test Page for HTTP/2 prioritization (server and browser)
- Host: GitHub
- URL: https://github.com/pmeenan/http2priorities
- Owner: pmeenan
- License: mit
- Created: 2018-11-21T14:09:33.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-01-03T16:07:45.000Z (almost 5 years ago)
- Last Synced: 2024-07-18T04:38:35.962Z (4 months ago)
- Language: HTML
- Size: 1.38 MB
- Stars: 108
- Watchers: 12
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# http2priorities
Test Page for HTTP/2 prioritization (server and browser). For the current status of prioritization support across CDN's, cloud and hostring providers please see Andy Davies' [status page](https://github.com/andydavies/http2-prioritization-issues) (and submit results to have them added).Server support for HTTP/2 prioritization requires getting a lot of things right (more details in the [Cloudflare blog post](https://blog.cloudflare.com/http-2-prioritization-with-nginx/)).
It is HIGHLY recommended you use the newer [stand-alone test](stand-alone) if possible which does not require being able to upload content to the system being tested.
## Legacy Test
This is a test page (also as a [WordPress plugin](wordpress)) for exercising HTTP/2 prioritization (particularly for Chrome). It is structured in such a way that the preload scanner will discover low-priority images that are displayed below the viewport and start loading them before 4 high-priority resources are discovered:
1. The custom font used for the page (not discovered until layout).
1. The background "pebble" image used for the page background (not discovered until layout).
1. The image of the car visible in the viewport (injected by javascript at the top of the page).
1. A blocking script at the end of the document (injected by document.write).The text near the top of the page will also change after the last blocking script is loaded to indicate that DOMContentLoaded has fired.
The test should work well on all modern browsers but it depends on browsers doing something intelligent with priorities. It was crafted specifically to exercise Chrome's prioritization and expose server prioritization issues.
To test, I HIGHLY recommend running the testing with a slow network connection (1.6 Mbps "3G Fast" should be fine). That will make any issues glaringly obvious. In case it wasn't obvious, you will need to deploy this test page on your server to use it as a test target and make sure it is HTTPS (otherwise HTTP/2 will not be used). DO NOT use Chrome Dev Tools' built-in connection profiles. The traffic shaping for those are done internal to the browser and introduce different buffers that lead to incorrect results. There are [good network-level options available on most platforms](https://calendar.perfplanet.com/2016/testing-with-realistic-networking-conditions/).
When it is working well you will see the important resources at the end of the waterfall completing quickly.
**IMPORTANT:** All Four high-priority requests need to complete early. It is not uncommon for one or two of them to complete early but bottom.js and visible.jpg get delayed. That is a symptom of a server that supports prioritization but with too much output buffering (it saw the font request before it had sent enough data to fill the buffers).
![Waterfall with important resources completing late.](docs/waterfall_good.png)
When it is not working well you will see them delayed significantly:
![Waterfall with important resources completing late.](docs/waterfall_bad.png)
The visual experience is also significantly faster when working correctly:
![Filmstrip](docs/filmstrip.png)
As of Chrome 70, the HTTP/2 dependency/priority tree for the page looks like this (all requests are marked as "exclusive"):
![Priority tree](docs/priorities.png)