Requests III allows you to send organic, grass-fed HTTP/1.1 & HTTP/2 (wip) requests, without the need for manual thought-labor. There’s no need to add query strings to your URLs, or to form-encode your POST data. Keep-alive and HTTP connection pooling are 100% automatic, as well.
Today I’m going to discuss a new, and very nice, site speed improvement that became possible in WordPress 4.1. What changed? The introduction of a new filter,
script_loader_tag. This filter lets us easily change the HTML markup of
headcan delay your browser from displaying page content, because its default behavior is first to interpret the JS files themselves.
headsection of your HTML document. On the internet as in nature, the main thing about a
headis that it’s above a
“Render-blocking” comes from a web browser’s default behavior: It wants to completely receive and process everything that’s come higher up in the page, before it moves any further down.
headcan actually delay your browser from displaying the page content in the
body, because its default behavior is first to interpret the JS files themselves. In other words, JS is blocking the browser’s crucial function of rendering the page out for the user to actually see. The result can be slow sites and frustrated users.
The first thing to understand is the alternatives to render-blocking JS:
Those are concepts—now for code. (The full code is available on GitHub.)
scriptelement. Letting us filter that HTML is what
script_loader_tagis for. (If you need an update on filters and WordPress’s hooks system in general, start here!)
Sphinx is a powerful documentation generator that has many great features for writing technical documentation including:
- Generate web pages, printable PDFs, documents for e-readers (ePub), and more all from the same sources
- You can use reStructuredText or Markdown to write documentation
- An extensive system of cross-referencing code and documentation
- Syntax highlighted code samples
- A vibrant ecosystem of first and third-party extensions
Quick start video