# PAC file is larger than 1 MiB

Source: https://findproxyforurl.net/rules/pac-larger-than-1-mib/ · last updated 2026-10-13

Rule PAC-D011 (`pac-larger-than-1-mib`), severity high, category: Delivery (HTTP headers).

Chrome, Edge and Windows do not load a PAC file larger than 1 MiB (1,048,576 bytes). The file is not shortened or partly used; the client behaves as if there were no PAC file at all.

## Why it matters

Clients set an upper limit on the size of a PAC file so that a broken server cannot fill their
memory. Chromium, and with it Chrome and Edge, stops the download as soon as more than
1,048,576 bytes (1 MiB) have arrived. In the lab, Windows (WinHTTP, the Windows HTTP service that
Windows programs and the system use to find their proxy) loaded a file of exactly 1,048,576
bytes and failed on a file that was one byte larger. In both cases the client does not use any
part of the file: it goes direct, or it fails if the proxy is mandatory.

A file this large almost always holds a long list of host names that belongs in the proxy's own
bypass or category settings (PAC-P006). Compression does not help, because the limit counts the
bytes after the client has unpacked them.


## How to fix

Move long host lists from the PAC file to the proxy and keep the file well below 1 MiB; a few hundred kilobytes is already slow.

## Bad

```js
HTTP/1.1 200 OK
Content-Type: application/x-ns-proxy-autoconfig
Content-Length: 2097152
```

## Good

```js
HTTP/1.1 200 OK
Content-Type: application/x-ns-proxy-autoconfig
Content-Length: 18342
```

## Engine behaviour

- chromium: The PAC download stops with an error as soon as the body exceeds 1,048,576 bytes (counted after decompression); the PAC is then not used. (source: code, verified 2026-10-13)
- winhttp: A PAC body of 1,048,576 bytes loaded; 1,048,577 bytes and larger (also 2, 10 and 33 MiB) failed to download (error 12167), so no PAC was used. (source: lab, verified 2026-10-11)
