# Large PAC served without compression

Source: https://findproxyforurl.net/rules/uncompressed-large-pac/ · last updated 2026-10-11

Rule PAC-D006 (`uncompressed-large-pac`), severity low, category: Delivery (HTTP headers).

A PAC of tens of kilobytes is fetched by every client on every refresh. Text compresses well; serving it gzip-encoded to the clients that ask for compression cuts the transfer without touching the file.

## Why it matters

PAC bodies are repetitive text and compress by a factor of three or more. Browsers send
`Accept-Encoding: gzip` on PAC fetches and accept compressed responses. For a large
deployment the saving is bandwidth on the PAC server and faster start-up on slow links;
compression does not fix the evaluation cost of a large file (PAC-P006), only its transfer.
Compress only for clients that ask for it, which is what web servers do by default: in the
lab (2026-10-11) Windows (WinHTTP) could not load a PAC that was sent gzip-compressed.


## How to fix

Enable gzip (mod_deflate / gzip on) for application/x-ns-proxy-autoconfig responses, only for requests that send Accept-Encoding gzip (the web server default); never send the file compressed to a client that did not ask for it.

## Bad

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

## Good

```js
HTTP/1.1 200 OK
Content-Type: application/x-ns-proxy-autoconfig
Content-Encoding: gzip
Vary: Accept-Encoding
Content-Length: 19744
```

## Engine behaviour

- winhttp: A PAC sent gzip-compressed (Content-Encoding: gzip) failed to load. (source: lab, verified 2026-10-11)
