# Conditional Headers based on User Agent

**URL:** <https://answers.netlify.com/t/conditional-headers-based-on-user-agent/415>\
**Category:** Support\
**Tags:** netlify-cdn-adn\
**Created:** [April 12, 2019, 3:04am UTC](https://answers.netlify.com/t/conditional-headers-based-on-user-agent/415 "2019-04-12T03:04:10Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![azizhk](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/azizhk/32/282_2.png) [@azizhk](https://answers.netlify.com/u/azizhk)\
**Post date:** [April 12, 2019, 3:04am UTC](https://answers.netlify.com/t/conditional-headers-based-on-user-agent/415/1 "2019-04-12T03:04:10Z")

</div>

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.

> **[HTTP/2 push is tougher than I thought](https://jakearchibald.com/2017/h2-push-tougher-than-i-thought/)**
>
> There are lots of edge cases I hadn't considered, and it's very inconsistent between browsers. Here's what I found…

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

---

<div class="post-metadata">

**Author:** ![fool](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/fool/32/37_2.png) [@fool](https://answers.netlify.com/u/fool)\
**Post date:** [April 13, 2019, 12:14am UTC](https://answers.netlify.com/t/conditional-headers-based-on-user-agent/415/2 "2019-04-13T00:14:31Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![azizhk](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/azizhk/32/282_2.png) [@azizhk](https://answers.netlify.com/u/azizhk)\
**Post date:** [April 13, 2019, 3:04am UTC](https://answers.netlify.com/t/conditional-headers-based-on-user-agent/415/4 "2019-04-13T03:04:52Z")

</div>

Oh 😓 😅

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” 😅 )

- “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)

---

<div class="post-metadata">

**Author:** ![perry](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/perry/32/16_2.png) [@perry](https://answers.netlify.com/u/perry)\
**Post date:** [July 10, 2019, 10:19am UTC](https://answers.netlify.com/t/conditional-headers-based-on-user-agent/415/5 "2019-07-10T10:19:27Z")

</div>

@azizhk - just now we announced the launch of Netlify Analytics at JAMstack conf London. You can learn more about that here: [Introducing: Netlify Analytics!](https://answers.netlify.com/t/introducing-netlify-analytics/1930)

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

---

<div class="post-metadata">

**Author:** ![calebeby](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/calebeby/32/2347_2.png) [@calebeby](https://answers.netlify.com/u/calebeby)\
**Post date:** [August 14, 2019, 4:30am UTC](https://answers.netlify.com/t/conditional-headers-based-on-user-agent/415/6 "2019-08-14T04:30:13Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![fool](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/fool/32/37_2.png) [@fool](https://answers.netlify.com/u/fool)\
**Post date:** [August 16, 2019, 10:42pm UTC](https://answers.netlify.com/t/conditional-headers-based-on-user-agent/415/7 "2019-08-16T22:42:51Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![hadyrashwan](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/hadyrashwan/32/7801_2.png) [@hadyrashwan](https://answers.netlify.com/u/hadyrashwan)\
**Post date:** [March 11, 2020, 9:55am UTC](https://answers.netlify.com/t/conditional-headers-based-on-user-agent/415/9 "2020-03-11T09:55:25Z")

</div>

Any news regarding support for redirect based on the headers ?

---

<div class="post-metadata">

**Author:** ![perry](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/perry/32/16_2.png) [@perry](https://answers.netlify.com/u/perry)\
**Post date:** [March 11, 2020, 4:30pm UTC](https://answers.netlify.com/t/conditional-headers-based-on-user-agent/415/10 "2020-03-11T16:30:40Z")

</div>

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 🙂

---

<div class="post-metadata">

**Author:** ![iamskok](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/iamskok/32/328_2.png) [@iamskok](https://answers.netlify.com/u/iamskok)\
**Post date:** [April 23, 2020, 4:53am UTC](https://answers.netlify.com/t/conditional-headers-based-on-user-agent/415/12 "2020-04-23T04:53:59Z")

</div>

I would also 🖤 to see H2 implemented.

---

<div class="post-metadata">

**Author:** ![fool](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/fool/32/37_2.png) [@fool](https://answers.netlify.com/u/fool)\
**Post date:** [April 25, 2020, 5:36am UTC](https://answers.netlify.com/t/conditional-headers-based-on-user-agent/415/13 "2020-04-25T05:36:49Z")

</div>

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 🙂

---

<div class="post-metadata">

**Author:** ![iamskok](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/iamskok/32/328_2.png) [@iamskok](https://answers.netlify.com/u/iamskok)\
**Post date:** [April 25, 2020, 5:48am UTC](https://answers.netlify.com/t/conditional-headers-based-on-user-agent/415/15 "2020-04-25T05:48:30Z")

</div>

Sorry for typo. Server push is actually what I meant 😊

---

<div class="post-metadata">

**Author:** ![fool](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/fool/32/37_2.png) [@fool](https://answers.netlify.com/u/fool)\
**Post date:** [March 17, 2021, 9:13pm UTC](https://answers.netlify.com/t/conditional-headers-based-on-user-agent/415/16 "2021-03-17T21:13:05Z")

</div>

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.
