# Confusing headers behaviour

**URL:** <https://answers.netlify.com/t/confusing-headers-behaviour/17588>\
**Category:** Support\
**Tags:** headers\
**Created:** [June 24, 2020, 8:50am UTC](https://answers.netlify.com/t/confusing-headers-behaviour/17588 "2020-06-24T08:50:34Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![jakearchibald](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/jakearchibald/32/2211_2.png) [@jakearchibald](https://answers.netlify.com/u/jakearchibald)\
**Post date:** [June 24, 2020, 8:50am UTC](https://answers.netlify.com/t/confusing-headers-behaviour/17588/1 "2020-06-24T08:50:34Z")

</div>

I’m seeing some really weird behaviour with headers.

Here’s my headers file:

```auto
/*
  X-Frame-Options: DENY

/*.c.*
  Cache-Control: max-age=31536000
  x-test-header: foo

```

I thought this would set the `Cache-Control` and `x-test-header` headers on URLs that contain `.c.`. But it seems to be missing from URLs I’d expect, and applied to URLs I wouldn’t expect.

- [https://5ef311f14d63d70008288937--focused-booth-abbed1.netlify.app/post-f0f398a1.c.png](https://5ef311f14d63d70008288937--focused-booth-abbed1.netlify.app/post-f0f398a1.c.png) - correctly has the headers
- [https://5ef311f14d63d70008288937--focused-booth-abbed1.netlify.app/1-04a7f70a.c.mp4](https://5ef311f14d63d70008288937--focused-booth-abbed1.netlify.app/1-04a7f70a.c.mp4) - headers are missing, despite URL containing `.c.`
- [https://5ef311f14d63d70008288937--focused-booth-abbed1.netlify.app/2019/service-workers-tpac/](https://5ef311f14d63d70008288937--focused-booth-abbed1.netlify.app/2019/service-workers-tpac/) - headers are applied, but URL does not contain `.c.`

Any idea what’s going on?

Project: [focused-booth-abbed1](https://app.netlify.com/sites/focused-booth-abbed1)

---

<div class="post-metadata">

**Author:** ![jakearchibald](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/jakearchibald/32/2211_2.png) [@jakearchibald](https://answers.netlify.com/u/jakearchibald)\
**Post date:** [June 24, 2020, 9:27am UTC](https://answers.netlify.com/t/confusing-headers-behaviour/17588/2 "2020-06-24T09:27:52Z")

</div>

Huh, I just saw [\_headers for newbies](https://answers.netlify.com/t/headers-for-newbies/9581) which suggests that `*` doesn’t really work as documented.

And [Custom headers for Large Media - #4 by luke](https://answers.netlify.com/t/custom-headers-for-large-media/6771/4) which says that headers can’t be applied to large media.

Could [Custom headers | Netlify Docs](https://docs.netlify.com/routing/headers/#syntax-for-the-headers-file) be updated to prevent others being tripped up by the headers issue? It doesn’t really mention the limitations, and I’m still not really sure what they are (can `*` only be at the end of a rule?). Also, my deploy says “All header rules deployed without errors.” - it seems like this would be a good place to point out if a header rule isn’t supported.

Could [Large Media requirements and limitations | Netlify Docs](https://docs.netlify.com/large-media/requirements-and-limitations/#limitations) be updated to prevent others being tripped up by the large media + headers issue?

Also, I’d like to disable large media on my site, and go back to plain git. [Large Media requirements and limitations | Netlify Docs](https://docs.netlify.com/large-media/requirements-and-limitations/#disable-large-media) says I need your help with that.

---

<div class="post-metadata">

**Author:** ![luke](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/luke/32/39_2.png) [@luke](https://answers.netlify.com/u/luke)\
**Post date:** [June 25, 2020, 5:07am UTC](https://answers.netlify.com/t/confusing-headers-behaviour/17588/3 "2020-06-25T05:07:45Z")

</div>

Hi, @jakearchibald, there is an open feature request for the docs change update about Large Media limitations with custom headers based on [the other topic you linked to](https://answers.netlify.com/t/custom-headers-for-large-media/6771/7). We’ll post an update there (and here) when the docs are updated.

About the [headers documentation](https://docs.netlify.com/routing/headers/#syntax-for-the-headers-file) it does say the following:

> Paths can contain `*` or `:placeholders` . A `:placeholder` matches anything except `/` , while a `*` matches anything.

There are no examples which show that this can be used with a file extension. What wording would make it more clear that a file extension cannot be used? Would this be better?

> Paths can contain `*` or `:placeholders` . A `:placeholder` matches anything except `/` , while a `*` matches anything.
> 
> You cannot use `*` to make rules like `/*.html` or `/*/more/path/segments/`. The `*` will match everything to the end of the line and `.html` and `/more/path/segments/` would be ignored.

Regarding the deploy saying “All header rules deployed” despite the rules not working, would you please send us a link to that deploy?

Regarding removing Large Media would you please look over the following Support Guide?

> [@\[Support Guide\] Uninstalling Large Media](https://answers.netlify.com/t/support-guide-uninstalling-large-media/17662):
>
> Last reviewed by Netlify Support in July 2025 Important This guide covers the process of uninstalling the Large Media add-on for a site. Notice: Once our support team uninstalls the Large Media add-on any copies of those files are no longer retrievable using our service. Please be absolutely certain you have local backups of all required files before directing our support team to uninstall the Large Media add-on from your site. Uninstalling Large Media Two considerations before we begin There…

That covers the steps involved. If you would then follow-up here with the identifier of the site, we’ll follow-up to let you know when the Large Media add-on is removed.

---

<div class="post-metadata">

**Author:** ![jakearchibald](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/jakearchibald/32/2211_2.png) [@jakearchibald](https://answers.netlify.com/u/jakearchibald)\
**Post date:** [June 25, 2020, 8:52am UTC](https://answers.netlify.com/t/confusing-headers-behaviour/17588/4 "2020-06-25T08:52:40Z")

</div>

> [@luke](#):
>
> Hi, @jakearchibald, there is an open feature request for the docs change update about Large Media limitations with custom headers based on [the other topic you linked to](https://answers.netlify.com/t/custom-headers-for-large-media/6771/7). We’ll post an update there (and here) when the docs are updated.

Excellent, cheers!

> [@luke](#):
>
> About the [headers documentation](https://docs.netlify.com/routing/headers/#syntax-for-the-headers-file) it does say the following:
> 
> > Paths can contain `*` or `:placeholders` . A `:placeholder` matches anything except `/` , while a `*` matches anything.
> 
> There are no examples which show that this can be used with a file extension.

I get that there isn’t an example of it being used to match file extensions, but I don’t think the absence of an example suggests it doesn’t work. Otherwise, that would suggest that `:placeholder` doesn’t work at all, since there isn’t a single example of it on that page. I don’t think that’s the case, and I don’t think that’s how folks interpret documentation.

> [@luke](#):
>
> What wording would make it more clear that a file extension cannot be used? Would this be better?
> 
> > Paths can contain `*` or `:placeholders` . A `:placeholder` matches anything except `/` , while a `*` matches anything.
> > 
> > You cannot use `*` to make rules like `/*.html` or `/*/more/path/segments/`. The `*` will match everything to the end of the line and `.html` and `/more/path/segments/` would be ignored.

I think it’s better to explain how it works, rather than give an incomplete description, then try and fill in the gaps with exceptions. If I’ve understood how it works correctly, I think this describes it:

> You can use `*` **at the end** of a pattern to match anything that appears afterwards. This makes the pattern a “starts with” match. So `/foo/*` will match any URL that _starts with_ `/foo/`, including `/foo/` itself, but also `/foo/bar/` and `/foo/hello/world/yo.html`.
> 
> **Warning:** Although `*` can only be used at the end of a pattern, Netlify does not validate this. Instead, any pattern characters after the first `*` are simply discarded. Netlify will silently accept a rule like `/posts/*.jpg`, but it _will not_ behave as you intend. It will be interpreted as `/posts/*`, so the rule will apply for `/posts/cat.jpg`, but it will also apply for `/posts/data.json`.

You need a strong warning here, because no one would include a rule like `/posts/*.jpg` expecting the `.jpg` to be ignored.

You wouldn’t need the strong warning if Netlify caught the issue at build time, and failed the build with a message like “Header rule error: `*` can only appear at the end of a pattern, see [url] for more details”.  
This is my preference, as I would have discovered the issue at build time, rather than in production.

> [@luke](#):
>
> Regarding the deploy saying “All header rules deployed” despite the rules not working, would you please send us a link to that deploy?

[Netlify App](https://app.netlify.com/sites/focused-booth-abbed1/deploys/5ef311f14d63d70008288937) - in this deploy I had a header rule like `/*.c.*`, which is being reinterpreted as `/*` without warning.

> [@luke](#):
>
> Regarding removing Large Media would you please look over the following Support Guide?
> 
> [[Support Guide] Uninstalling Large Media](https://answers.netlify.com/t/support-guide-uninstalling-large-media/17662)
> 
> That covers the steps involved. If you would then follow-up here with the identifier of the site, we’ll follow-up to let you know when the Large Media add-on is removed.

Cheers! I’ll put all that in a separate reply.

---

<div class="post-metadata">

**Author:** ![jakearchibald](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/jakearchibald/32/2211_2.png) [@jakearchibald](https://answers.netlify.com/u/jakearchibald)\
**Post date:** [June 25, 2020, 9:04am UTC](https://answers.netlify.com/t/confusing-headers-behaviour/17588/5 "2020-06-25T09:04:15Z")

</div>

Consideration #1: Yeah, I’ll deploy to a test branch initially. I’ve also made an additional clone of the repo, including large files, just in case everything goes wrong.

Consideration #2: Yeah, I’ll continue to use Git LFS. I’ve set `GIT_LFS_ENABLED=true`.

Is there a way to set `GIT_LFS_FETCH_INCLUDE` to match everything?

Fwiw, [[Support Guide] Uninstalling Large Media](https://answers.netlify.com/t/support-guide-uninstalling-large-media/17662) refers to the environment variables as “headers” which might confuse folks.

I think I’m ready for “Large Media add-on” to be removed.

---

<div class="post-metadata">

**Author:** ![jakearchibald](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/jakearchibald/32/2211_2.png) [@jakearchibald](https://answers.netlify.com/u/jakearchibald)\
**Post date:** [June 29, 2020, 8:01am UTC](https://answers.netlify.com/t/confusing-headers-behaviour/17588/6 "2020-06-29T08:01:59Z")

</div>

Is there anything else you need from me before “Large Media add-on” is disabled?

---

<div class="post-metadata">

**Author:** ![luke](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/luke/32/39_2.png) [@luke](https://answers.netlify.com/u/luke)\
**Post date:** [June 30, 2020, 7:01am UTC](https://answers.netlify.com/t/confusing-headers-behaviour/17588/7 "2020-06-30T07:01:26Z")

</div>

Hi, @jakearchibald, the Large Media add-on has been removed now. For the `GIT_LFS_FETCH_INCLUDE` questions, I do believe `GIT_LFS_FETCH_INCLUDE=*` does just this.

I fixed the reference to “headers” in the support guide also. The feature requests and docs issues still need filing and I will follow-up again to confirm when that is complete as well.

---

<div class="post-metadata">

**Author:** ![jakearchibald](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/jakearchibald/32/2211_2.png) [@jakearchibald](https://answers.netlify.com/u/jakearchibald)\
**Post date:** [June 30, 2020, 8:29am UTC](https://answers.netlify.com/t/confusing-headers-behaviour/17588/8 "2020-06-30T08:29:45Z")

</div>

Excellent. I’ve done the additional steps and redeployed. Everything looks good now. Many thanks for the the help!

---

<div class="post-metadata">

**Author:** ![jakearchibald](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/jakearchibald/32/2211_2.png) [@jakearchibald](https://answers.netlify.com/u/jakearchibald)\
**Post date:** [October 3, 2021, 4:02pm UTC](https://answers.netlify.com/t/confusing-headers-behaviour/17588/11 "2021-10-03T16:02:41Z")

</div>

The header documentation on the Netlify site is still unclear. The alternative given in [Confusing headers behaviour - #4 by jakearchibald](https://answers.netlify.com/t/confusing-headers-behaviour/17588/4) would be better

---

<div class="post-metadata">

**Author:** ![Scott](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/scott/32/26136_2.png) [@Scott](https://answers.netlify.com/u/Scott)\
**Post date:** [October 8, 2021, 7:40am UTC](https://answers.netlify.com/t/confusing-headers-behaviour/17588/14 "2021-10-08T07:40:29Z")

</div>

Valuable feedback, @jakearchibald. Thanks! We’ve got a docs enhancement feature request raised internally so we can put this limitation and considerations on the team’s radar. We’ll loop back if and when any changes are considered!
