PAC-D005 · cache-control-too-long

PAC cached for more than a day

low · Delivery (HTTP headers)

A max-age of several days lets proxies, CDNs and clients that keep the PAC file in an HTTP cache use a wrong or outdated file for that long. Chrome and Firefox are not affected. Keep max-age at a day or less.

Why it matters

Chrome, Edge and Firefox fetch the PAC file past the HTTP cache, so for them max-age changes nothing; the page Reset the PAC cache shows when they load the file again. Caches between the server and the client (a reverse proxy, a CDN, a forward proxy) and clients that use an ordinary HTTP cache do follow it. With max-age=604800 such a cache can hand out a PAC file that routes a critical application wrongly for a week. Keep max-age at a day (86400 seconds) or less; 3600 is a common choice.

How to fix

Lower max-age to 86400 or less (3600 is a common choice).

Examples

Bad

HTTP/1.1 200 OK
Content-Type: application/x-ns-proxy-autoconfig
Cache-Control: max-age=2592000
Open bad example in checker

Good

HTTP/1.1 200 OK
Content-Type: application/x-ns-proxy-autoconfig
Cache-Control: max-age=3600
Open good example in checker

Related rules

References

Last updated: