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?