Conditional Headers based on User Agent

So I wanted to implement http2 push. But there is some varying browser support at the moment which might result in performance degradation on a few browsers.

So I was hoping if I could target only specific browsers?

Hey Aziz,

We don’t have server push enabled right now, so it’s a bit of a moot point. I’m working with our documentation team to remove the documentation about it since I don’t know how soon we’ll re-enable it. However, we also don’t have functionality at the headers or redirect level to target specific browsers at present.

I’ve added this thread to our feature-request-tracker, which brings two benefits:

  1. So folks are encouraged to do the same thing as you, and spell out their (related - we’ll start a new thread for other features) use case in detail. It’s often the case that we have a workaround, or that there is some other way to achieve their goal, plus that use case will inform our eventual feature development in case we do implement the feature.
  2. if you’ve indicated interest, we can follow up to let you know if we do ship the feature at some point in the future.
1 Like

Oh :sweat: :sweat_smile:

Can you share why you had to disable it, @fool? Would love to learn from your experience.

Also can you add these points as part of the feature request (Maybe “Good to have” :sweat_smile: )

  • “Cache-aware Server Push” like H20 or mod_http2’s H2PushDiarySize directive.
  • Bandwidth use statistics. Percentage Usage by H2 Push. This might help users debug if they have implemented something wrong with H2 push or are abusing it.
  • Good defaults on which User Agents to push assets. (Maybe allow overriding)
1 Like

@azizhk - just now we announced the launch of Netlify Analytics at JAMstack conf London. You can learn more about that here: Introducing: Netlify Analytics!

Now you can learn a lot more information about your bandwidth use.

1 Like

@fool I’d also like to hear why h2 push has been disabled, and whether it will be re-enabled soon

1 Like

It was disabled because it didn’t work well, and the results were generally not a big performance win for our customers even after we implemented features to “protect people from themselves” (loading /common.js for /* meant we loaded common.js a second time when loading common.js as well as index.html).

We do not have a timeline to re-enable, but we will inform this thread in case we do.

2 Likes

Any news regarding support for redirect based on the headers ?

Hi @hadyrashwan, I don’t have any new information at the moment, but if I do hear something, one of us will update this thread :slight_smile:

1 Like

I would also :black_heart: to see H2 implemented.

HTTP/2 is still enabled. It’s just server push that is not. We didn’t see any big wins for customers speed wise in our tests, to be honest.

We’ll still follow up in this thread if we ever re-enable it :slight_smile:

Sorry for typo. Server push is actually what I meant :blush:

1 Like

Hey folks! Just wanted to mention that our product team has made a decision not to ever support HTTP/2 server push, since Chrome is going to deprecate it. We’ll focus on supporting HTTP/3 in the medium term instead, since it will offer better performance gains.

1 Like