Ahmad Awais



WordPress and HTTP/2 — What Developers Need to Know?

Ahmad AwaisAhmad Awais

Can you imagine what would happen if you try to develop a website with a computer which you bought in 1997? — Yes! That’s even before Google — I want you to stop reading for a moment — stop everything and close your eyes — just imagine how it would be to do what you do now on a computer that old?


Front-End Development Pain Points#

If you read my previous post about Advanced Gulp Workflow for WordPress, chances are you already know a lot about the pain points of front-end development. So, instead of explaining what they are, let’s shift our focus towards HTTP/2 in this post.

If you’re still reading this post, it means you have an above average interest in how the internet works, while you’re at it take a look at super cute web comics about How DNS Works by good folks at @DNSimple.

So, let’s begin with the front-end development pain points, shall we.

So, what’s the deal?

HTTP 1.1 was standardized in 1997. While it did a good job, it is no more efficient and to top it off, it was designed 16 years ago. Just like the desktop you had in 1997, this protocol was not designed to deal with today’s internet. It was designed before we even knew what the world wide web would become. So, to get it working in this age, we had to improvise hacks that could help make our websites fast and more optimized.

Why We Needed These Hacks?#

Let’s review why we needed these performance techniques in the first place.

Why HTTP/2#

HTTP/2 is efficient and fast. HTTP/2 is almost here. The fun fact is that your browser most probably is already using HTTP/2.

I ain’t no expert on this topic, which is why I won’t go into details, though, as James Spader would say in Boston Legal —”I know enough to be dangerous”.

If, like me, you develop WordPress themes, then here is what you really need to know. Hacks and performance fixes which we had for HTTP 1.1 will actually slow down your theme’s page loading speed in HTTP/2.




Well, let’s see what makes HTTP/2 so much better when compared with the 16 years older version.

Advantages of HTTP/2#

What Can YOU Be Doing Wrong?#

In context of HTTP/2 being rapidly accepted by browsers here’s what you could be doing wrong in an ideal world with browsers, hosts and CDNs serving sites over  HTTP/2

If you are developing a site which you know is going to be served over HTTP/2 then don’t use any of these legacy performance hacks.

I Want a Demo?#

Here’s the mini-cherry on top of the regular cherry on top of the sundae of awesomeness i.e. HTTP/2 — A few demos and implementations of HTTP/2

Which Browser Support HTTP/2

HTTP/2 Support for HTTP/HTTPS Servers

There’s an excellent write-up by Daniel Stenberg going into much more detail available as a PDF.

What Is Your Take on This?#

I help businesses understand developers 📟 Currently recording Node.js CLI Automation Course 👨‍🏫 Edutainer at VSCode.pro 🎩 An award-winning open-source engineer and developer advocate 🦊 Google Developers Expert for web 🌳 Node.js foundation Community Committee member ✌️ Author of various open-source dev-tools and software libraries used by millions of developers worldwide ⓦ WordPress Core Developer 📣 TEDx Speaker 🙌 Leading developers and publishing technical content for over a decade 😂 Self-confessed tech comedian cracking silly jokes in the JavaScript web and cloud communities 💜 Loves his wife (Maedah) ❯ Learn more about Awais ↣

Say 👋 on Twitter @MrAhmadAwais | Subscribe to the Developers Takeaway!


Developers Takeaway

Takeaway my professional opinion on open-source, developer relations, growing your business with family, and everything in between! Delivered to your inbox a couple of times every year. I'm even funny at times. I hate spam — pinky-promise!

👨‍💻👩‍💻 115,834 Developers Already Subscribed