Ahmad Awais

NAVIGATE


SHARE


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?

HTTP2_AhmadAwais

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.

How?

Why?

What?

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?#

Helping businesses understand developers. Head of Developer Relations RapidAPI 📟 Edutainer at Node.js CLI Automation and VSCode.pro 🎩 Award-winning Open Source Engineer & Dev Advocate 🦊 Google Developers Expert Web DevRel 🚀 Mars Ingenuity Helicopter code contributor 🏆 8th GitHub Stars Award recipient 🌳 Node.js foundation Community Committee Outreach Lead, Member Linux Foundation, OpenAPI, DigitalOcean Navigator ✌️ Author of various open-source dev-tools and software libraries used by millions of developers worldwide WordPress Core Developer 📣 TEDx Speaker with 100+ talks 🙌 Leading developers and publishing technical content for over a decade 💜 Loves his wife (Maedah) ❯ Learn more →

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!

👨‍💻👩‍💻 118,947 Developers Already Subscribed
Comments 6
  • Warre
    Posted on

    Warre Warre

    Reply Author

    If the connection of HTTP\2 will stay open during the website visitation, does this mean ajax calls to retrieve new data will become obsolete and be implemented in a different way? And what about compatibility mode? (websites will need to run on both 1.1 & 2)


    • Ahmad Awais
      Posted on

      Ahmad Awais Ahmad Awais

      Reply Author

      I don’t think that there will be any change to that. But you should check it on your own, for the sake of being more precise.
      So, far, websites will seamlessly shift to HTTP/2, that’s my understanding.


  • Kostas
    Posted on

    Kostas Kostas

    Reply Author

    Hey Ahmad amazing article you have there.
    Some clarifications though would be much apreciated

    1) From your article seems that HTTP2 will not change the usuall HTTP methods (Get,Put,Post,Delete) that we
    use in our API calls from browser or a RESTful addon to a browser? Is that accurate?
    2) GZIP commpression will still be be so vital in terms of performance ?
    3) the DOM of the a website that was served from HTTP1/1 will be exactly the
    same compared from the DOM transfered through HTTP2 ?
    4) Sessions/Cookies management will be the same in terms of web programming ?


    • Ahmad Awais
      Posted on

      Ahmad Awais Ahmad Awais

      Reply Author

      You might want to check these details via the spec reference pdf.


  • Justin Avery
    Posted on

    Justin Avery Justin Avery

    Reply Author

    Hey Ahmad, thanks for writing this up.

    I ended up posting some detailed instructions on how to get this going as well, I hope this helps someone else out too.