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

Founder & CEO at Langbase.com — The Composable AI Developer platform · Serverless AI Cloud · Ship agentic AI pipes, tools, and memory with BaseAI — The first Web AI Framework (free, open-source, local-first, deploys serverless, agentic pipes, tools, and memory)

Ex VP DevTools & DevRel Eng. Rapid · Google Developers Advisory Board (gDAB) founding member. 🧑‍💻 AI/ML/DevTools Angel InvestorAI/ML Advisory Board San Francisco, DevNetwork

🎩 Award-winning Open Source Engineer & Dev Advocate 🦊 Google Developers Expert Web DevRel 🚀 NASA Mars Ingenuity Helicopter mission code contributor 🏆 8th GitHub Stars Award recipient with 5x GitHub Stars Award (Listed as GitHub's #1 JavaScript trending developer).

🌳 Node.js foundation Community Committee Outreach Lead, Member Linux Foundation, OpenAPI Business Governing Board, and DigitalOcean Navigator. 📟 Teaching thousands of developers Node.js CLI Automation and VSCode.pro course. Over 142 million views, 24 yrs Blogging, 108K developers learning, 200+ FOSS.

✌️ Author of various open-source dev-tools and software libraries utilized by millions of developers worldwide WordPress Core Developer 📣 TEDx Speaker with 100+ international talks.

As quoted by: Satya Nadella · CEO of Microsoft — Awais is an awesome example for developers.
💜 Loves his wife (Maedah) ❯ Read more about Ahmad Awais.

👋… Awais is mostly active on 𝕏 @MrAhmadAwais

📨

Developers Takeaway

Stay ahead in the web dev community with Ahmad's expert insights on open-source, developer relations, dev-tools, and side-hustles. Insider-email-only-content. Don't miss out - subscirbe for a dose of professional advice and a dash of humor. No spam, pinky-promise!

✨ 172,438 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.