Score:1

HTTP/2 is way slower than HTTP/1.1

pl flag

I am hosting my WordPress website on a VPS located in Hong Kong. And I am trying to switch my Apache from HTTP/1.1 to HTTP/2.

However, after switched, I found that the speed is pretty low for HTTP/2 (about 2-5 times slower).

Both with exactly the same configuration, in a "pure WordPress way", without any of the cache plugin or CDN setup.

Here are the steps I followed: https://gist.github.com/GAS85/38eb5954a27d64ae9ac17d01bfe9898c

And below is how I configured my Apache vHost:

<VirtualHost *:443>
  Protocols h2 http/1.1
  H2Direct on
  H2Push on
  H2PushPriority * after
  H2PushPriority text/css before
  H2PushPriority image/jpg after 32
  H2PushPriority image/jpeg after 32
  H2PushPriority image/png after 32
  H2PushPriority application/javascript interleaved
  ... (with SSL and rewrite setup)
</VirtualHost>

And below are the WebPageTest link for my website (I choose Shanghai as the testing point): For HTTP/2 https://www.webpagetest.org/result/210618_BiDcE4_b8fee184df95343c5d2088a365f57da0/ and For HTTP/1 https://www.webpagetest.org/result/210618_BiDc92_93d22a82637f12c40ab03c75d79fefe7/

I understand that, if correctly, HTTP/2 only uses one TCP to connect to the server.

But, any idea about how can HTTP/2 be slower than HTTP/1.1?

Should I switch back to HTTP/1.1?

Is there any configuration issue in my Apache?

Michael Hampton avatar
cz flag
Your site is hosted outside of China, more specifically outside the great firewall, so you should do speed tests from locations which are also outside the great firewall. Tests from inside to a site outside may not be valid due to interference from the great firewall.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.