---
title: "Serving custom HTTP headers | Netlify"
description: "Realize the speed, agility and performance of a scalable, composable web architecture with Netlify. Explore the composable web platform now!"
source: "https://www.netlify.com/blog/2021/12/31/serving-custom-http-headers/"
last_updated: "2026-07-11T00:33:13.000Z"
---
> Throughout December we’ll be [highlighting a different Netlify feature each day](/blog/2021/12/01/highlighting-a-different-netlify-feature-each-day-in-december/?utm_campaign=featdaily21&utm_source=netlify&utm_medium=blog&utm_content=custom-headers). It might just be the thing you need to unlock those creative juices, and [dust off that domain](https://www.netlify.com/blog/2021/12/01/dusty-domains-your-forgotten-domains-raise-money-for-charity/?utm_campaign=featdaily21&utm_source=netlify&utm_medium=blog&utm_content=custom-headers) you registered but never deployed! Keep an eye [on the blog](https://www.netlify.com/blog/2021/12/01/highlighting-a-different-netlify-feature-each-day-in-december/?utm_campaign=featdaily21&utm_source=netlify&utm_medium=blog&utm_content=custom-headers) and on [Twitter](https://twitter.com/netlify) for each feature!

[Each day this month](https://www.netlify.com/blog/2021/12/01/highlighting-a-different-netlify-feature-each-day-in-december/?utm_campaign=featdaily21&utm_source=netlify&utm_medium=blog&utm_content=custom-headers) we’ve looked at a different Netlify feature. We’ve learned lots of ways we can use Netlify to build and to serve our web sites, apps, and stores without needing us to first become experts in all of the different parts of the web technology stack.

Netlify aims to make it easier for all developers (irrespective of experience and expertise) to build better web projects, and to help getting those projects out into the world with the least amount of effort and friction.

## Sensible defaults, simple customisations

When it comes to delivery, very many web projects can adopt some carefully and expertly established defaults. Thanks to the skills of the teams of engineers at Netlify we can inherit all of the clever hosting, caching, and deployment behaviours designed right into the system. (Seriously! [Thanks, you lot](https://www.netlify.com/about/)!) It gives us access to things like [instant rollbacks](https://www.netlify.com/blog/2021/12/08/instant-deploy-rollbacks/?utm_campaign=featdaily21&utm_source=netlify&utm_medium=blog&utm_content=custom-headers), [branch deploys](https://www.netlify.com/blog/2021/12/05/unlimited-environments-thanks-to-branch-deploys/?utm_campaign=featdaily21&utm_source=netlify&utm_medium=blog&utm_content=custom-headers), [auto-publishing control](https://www.netlify.com/blog/2021/12/04/controlling-auto-publishing-for-coordinated-releases/?utm_campaign=featdaily21&utm_source=netlify&utm_medium=blog&utm_content=custom-headers), and so much more. All without needing to become experts in the underlying technologies used to deploy and to host our sites.

Occasionally though, we might need something more exotic. Maybe we need to have some additional control over things like the HTTP headers and caching behaviours. Usually the defaults will serve us just fine, but _expert mode_ is available just incase!

## Serving custom headers

You can [make custom adjustments to the default HTTP headers](https://docs.netlify.com/routing/headers/?utm_campaign=featdaily21&utm_source=netlify&utm_medium=blog&utm_content=custom-headers) being served in your web sites by adding a `_headers` file to your publish directory, or by adding some configurations to your `netlify.toml` file.

For instance, perhaps you are serving some data files to your site which you don’t want to be cached by your site visitors. You can override the defaults and specify your own cache-control headers for all the assets served in the `/data/` folder like this:

```
# Example configuration in a _headers file
/data/*  cache-control: max-age=0  cache-control: no-cache  cache-control: no-store  cache-control: must-revalidate
```

Access to this kind of control _if_ it is really needed means that we can continue to benefit from all of the defaults and automations and features of the Netlify platform, but occasionally extend and tune some aspects when a particularly complex scenario comes along.

Whatever you are building, be it a bit of fun, a personal project, or a global enterprise site, the features we’ve mentioned here this month should help you go from concept to reality.

Happy developing!

## More information

-   [Docs: Custom headers](https://docs.netlify.com/routing/headers/?utm_campaign=featdaily21&utm_source=netlify&utm_medium=blog&utm_content=custom-headers)

### Share

-   [X (fka Twitter)](https://twitter.com/intent/tweet?text=Serving custom HTTP headers&url=https://www.netlify.com/blog/2021/12/31/serving-custom-http-headers//)
-   [LinkedIn](https://www.linkedin.com/shareArticle?mini=true&url=https%3A%2F%2Fwww.netlify.com%2Fblog%2F2021%2F12%2F31%2Fserving-custom-http-headers%2F%2F)
-   [Facebook](https://www.facebook.com/sharer.php?u=https://www.netlify.com/blog/2021/12/31/serving-custom-http-headers//)
-   [Bluesky](https://bsky.app/intent/compose?text=Serving custom HTTP headers+https://www.netlify.com/blog/2021/12/31/serving-custom-http-headers//)

* * *

### Tags

-   [Configuration](/blog/tags/configuration/)
-   [Development](/blog/tags/development/)

## Keep reading

![](/images/blog-fallback-thumbnail.svg)

News & Announcements February 16, 2017

[

### Verifying your header rules configuration

](/blog/2017/02/16/verifying-your-header-rules-configuration/)

-   ![Profile picture of David Calavera](/_astro/b2c93213782e53ba9493a107f1917a1a44d0d9e5-80x80_tFwf6.webp)
    
    David Calavera
    

![](/images/blog-fallback-thumbnail.svg)

News & Announcements October 17, 2017

[

### Introducing Structured Redirects and Headers

](/blog/2017/10/17/introducing-structured-redirects-and-headers)

-   ![Profile picture of David Calavera](/_astro/b2c93213782e53ba9493a107f1917a1a44d0d9e5-80x80_tFwf6.webp)
    
    David Calavera
    

## Recent posts

News & Announcements June 25, 2026

[

### Netlify Functions, designed for Agent Experience

](/blog/netlify-functions-designed-for-agent-experience)

-   ![Profile picture of Eduardo Bouças](/_astro/52958f21e8450baf6d8e60302341a984e220c0cd-512x512_13VDlu.webp)
    
    Eduardo Bouças
    

News & Announcements June 24, 2026

[

### How we measure Netlify’s Agent Experience

](/blog/how-we-measure-netlify-agent-experience)

-   ![Profile picture of Sean Roberts](/_astro/bbf2243f8171dbddd80ab2103622106cef84d125-512x512_Z1d2LKE.webp)
    
    Sean Roberts
    

Guides & Tutorials May 15, 2026

[

### How to build a real-time AI chatbot in minutes with Netlify Agent Runners (no backend)

](/blog/how-to-build-a-real-time-ai-chatbot-in-minutes-with-netlify-agent-runners-no-backend)

-   ![Profile picture of Nahrin Jalal](/_astro/f0e7c8f227a03fe58340c99ef5439d5a896c0733-272x272_Z23kDpD.webp)
    
    Nahrin Jalal
    

![](/_astro/3f255b372fa958df35802666ee33b4609b2d71bd-1200x1586_1VtE2D.webp)

### How do the best dev and marketing teams work together?

[Access the report](https://www.netlify.com/reports/2024-leadership-trend-report/access/)