[▲ Vercel Community](/) · [Categories](/categories) · [Latest](/latest) · [Top](/top) · [Live](/live)

[Help](/c/help/9)

# How can I tell if my vercel.json file is being picked up by my site?

119 views · 2 likes · 4 posts


Jamie Cropley (@jamiecropley) · 2024-08-12

So I tested my site [https://jamiecropley.ai](https://jamiecropley.ai) here https://tools.pingdom.com/#64523c7cff000000 and it says expires headers and gzip is not being picked up on my site, and I can't find it in inspector in Chrome browser either the following information from my **vercel.json** file:


```
{
  "headers": [
    {
      "source": "/(.*)\\.(jpg|jpeg|png|gif|ico|svg)$",
      "headers": [
        {
          "key": "Cache-Control",
          "value": "public, max-age=31536000, immutable"
        }
      ]
    },
    {
      "source": "/(.*)\\.(css|js)$",
      "headers": [
        {
          "key": "Cache-Control",
          "value": "public, max-age=2592000"
        },
        {
          "key": "Content-Encoding",
          "value": "gzip"
        }
      ]
    },
    {
      "source": "/(.*)\\.(html)$",
      "headers": [
        {
          "key": "Cache-Control",
          "value": "public, max-age=604800"
        },
        {
          "key": "Content-Encoding",
          "value": "gzip"
        }
      ]
    }
  ]
}
```

Firstly, is my vercel.json file correct? Can I trust what that site is saying? How can I validate my vercel.json file overall in respect of gzip and Expires headers?


Swarnava Sengupta (@swarnava) · 2024-08-13 · ♥ 1

Hi there,

[quote="jamiecropley, post:1, topic:561"]
`"source": "/(.*)\\.(jpg|jpeg|png|gif|ico|svg)$",`
[/quote]

I think what you are trying to achieve is:

> `"source": "/(.*).(jpg|jpeg|png|gif|ico|svg)",`

[quote="jamiecropley, post:1, topic:561"]
gzip is not being picked up on my site
[/quote]

The compression on Vercel will be based on the `Accept-Encoding` header sent in the request, if the header specifies brotli (br) is supported it will be used over gzip. Unfortunately you cannot setup custom `Content-Encoding` header at this point. While double-compressing the file is one way to add the header, it’s the wrong way and makes performance worse. (the browser will natively decompress our second compression, but then JS will still need to decompress the inner compression)


Jamie Cropley (@jamiecropley) · 2024-08-13

OK so your advice fixed all my issues.

This is now my updated vercel.json file incase anyone else wishes to see:


```
{
  "headers": [
    {
      "source": "/(.*).(jpg|jpeg|png|gif|ico|svg)",
      "headers": [
        {
          "key": "Cache-Control",
          "value": "public, max-age=31536000, immutable"
        }
      ]
    },
    {
      "source": "/(.*).(css|js)",
      "headers": [
        {
          "key": "Cache-Control",
          "value": "public, max-age=2592000"
        }
      ]
    },
    {
      "source": "/(.*).(html)",
      "headers": [
        {
          "key": "Cache-Control",
          "value": "public, max-age=604800"
        }
      ]
    }
  ]
}
```

One thing I have noticed I think this https://tools.pingdom.com/ tool does not check for Brotli I believe?

> "The compression on Vercel will be based on the `Accept-Encoding` header sent in the request, if the header specifies brotli (br) is supported it will be used over gzip. Unfortunately you cannot setup custom `Content-Encoding` header at this point. While double-compressing the file is one way to add the header, it’s the wrong way and makes performance worse. (the browser will natively decompress our second compression, but then JS will still need to decompress the inner compression)"

I was not to sure what was meant from this. 

Am I right to presume at this point my site is using brotli compression by default on vercel therefore its not being picked up on that tool? I tried other tools and it says its there, brotli compression that is e.g. on https://www.giftofspeed.com/gzip-test/


Swarnava Sengupta (@swarnava) · 2024-08-13 · ♥ 1

Only certain [MIME types](https://vercel.com/docs/edge-network/compression#mime-types-vercel-edge-network-compress) support Compression. If you test https://www.jamiecropley.ai/css/main.min.css against tool like https://tools.keycdn.com/brotli-test, it should show you.