Apache HTTP/2 finally activated for Shared Hosting!

Callooh! Callay! I noticed that in the last few days my sites are being served via HTTP/2. The change appears to still be rolling out, because a friend’s site on a different server is still HTTP/1. I’m glad it is here, but it’s been a long wait, as I’m sure @keyplyr will agree.

Questions I have are:

  • Are there any HTTP/2 issues to watch out for? Config changes needed?
  • Do HTTP/2 features, like Server-Push work?
1 Like

“as I’m sure @keyplyr will agree”

I agree :slight_smile:

1 Like

No Push unless you add it manually in htaccess, check here: https://http2.pro/

For me, speed issues are often css files: my site-wide css, bootstrap css & bootstrap-theme css.

• The tool didn’t recognise Push combining all 3 into one header directive:

Header set Link "rel=preload; as=style; </css/style.css>,</css/bootstrap.min.css>,</css/bootstrap-theme.min.css>"  

• The tool did recognise Push when I added the three files separately:

Header set Link "</css/style.css>; rel=preload; as=style"  
Header set Link "</css/bootstrap.min.css>; rel=preload; as=style"  
Header set Link "</css/bootstrap-theme.min.css>; rel=preload; as=style"  

• Also, the tool did recognise Push when I combined the 3 files including the attributes:

Header set Link "</css/style.css>; rel=preload; as=style, </css/bootstrap.min.css>; rel=preload; as=style, </css/bootstrap-theme.min.css>; rel=preload; as=style" 

This last method seems to be the most succinct… however there should be a way of setting the header generically for all/any files. Everything I’ve read so far says they need to be done individually. This doesn’t seem right,

Once the headers have been added, you can also verity Push with the desktop Chrome browser either by using the Developer Tools or by:

• Open your webpage using the latest desktop Chrome browser
• Right-click anywhere in the content area, choosing Inspect
• Choose the Network tab
• Right-click the Name column and add Protocol
• Check the Disable Cache box
• Reload the page and look at the file type you’re choosing to Push. It should say “Push/Other” if Push is working.

Note1: this tool has intermittent accuracy because of your website caching, so it may take a few tries or reloads. If it says “Push/Other” at any point after you’ve Disabled Cache & reloaded the page, then Push is working.

Note2: Google Page Speed is not currently showing load time benefits of Push, unless you implemented Push several months ago so user experience is used.

I actually prefer this browser verification method over any 3rd party tool. After all, this is for site visitors using a browser.

Thanks for digging in @keyplyr – I’m just getting up to speed and all the notes are helpful.

One tip I picked up from Smashing Mag’s server push article is that the push headers should only be sent for HTML files, so a conditional is needed. For example a Files or FilesMatch directive [typo fixed from below]:

<FilesMatch "\.html$">
    Header set Link "</css/styles.css>; rel=preload; as=style"
</FilesMatch>

Without that conditional, the push headers will be sent will all files, causing browsers to download the CSS even when only visiting PDFs, images, etc.

Have you tried the files match approach? It crashed my site with a 500 error.

Oops, a typo – A / is needed for the closing FilesMatch:

<FilesMatch "\.html$">
    Header set Link "</styles.css>; rel=preload; as=style"
</FilesMatch>

:slight_smile: easy to overlook those closing brackets, Mr Smashing left it off.

[added]
That Smashing Mag page was one of the several I initially read. I saw that all the examples used the FilesMatch wrapper, but assumed it was not needed since there are no calls for css (the file type I’m currently Pushing) from anything other than HTML.

But now that I think about it, this is a preload action, just done from the server instead of the web page mark-up so it makes sense.

Another related point… Googlebot will start crawling in HTTP/2 in November 2020.

The article says there is no direct ranking bennefit if Googlebot crawls your site using HTTP/2 but since load time has increasingly become a ranking factor, especially with mobile, it would be wise to get all these tweaks completed by then.

Now i need understand more about HTTP/2, thanks for the explanation about Ranking Factors.

Earlier I wrote that Google’s Page Speed did not recognize Push. I was wrong.

I call several scripts & CSS files from my site-wide header (via SSI) which have always cost me a few points in my score. These files were identified under Eliminate Render-Blocking Resources.

I stuck all the files (total of 9) into the Push header and voila! they are no longer listed as render-blocking and I gained points.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.