cancel
Showing results for 
Search instead for 
Did you mean: 
feickholt
Level 10

PAC File Caching?

I have a general Question about PAC-File

We build dynamic Pac.-Files using the MWG.

We can see in our logfile that clients requests the file very often. 

I thought the pac-file will be cached on the clients. Is this right?

Is there a way to influence the caching time? (60min might be enough) Maybe using some header varibales (Cache-Control..) ?

Are there different browser implementation for caching the pac-file? (IE,Firefox,Chrome)

Thanks
Frank

0 Kudos
2 Replies

Re: PAC File Caching?

Hi,

most browsers should respect the cache fields in HTTP headers. Cache headers with a timeout of 1 hour (3600 seconds) should be added automatically if you serve proxy.pac using the file server feature of MWG 7, but that will only work for static content.

You can display the HTTP headers with curl (adapt the URL as appropriate). Check output for Cache-Control header (maxage=3600 specifies timeout value of 1 hour). Date header shows time on server, Expires header time when file will expire. Time difference should be 1 hour, too. Not sure how exactly you are creating dynamic pac files, but make sure you add those cache headers.

# curl -i http://MWG7APPLIANCE:4711/files/proxy.pac

HTTP/1.1 200 OK

Expires: Fri, 26 Jul 2013 08:52:08 GMT

Cache-Control: max-age=3600

Accept-Ranges: bytes

ETag: W/"0-1374825091000"

Last-Modified: Fri, 26 Jul 2013 07:51:31 GMT

Content-Type: application/x-ns-proxy-autoconfig

Content-Length: 0

Date: Fri, 26 Jul 2013 07:52:08 GMT

Server: mwg-ui

Cya, Ed

0 Kudos
eelsasser
Level 15

Re: PAC File Caching?

Yes. You can insert the cache control header as it is being delivered to client.

Header.Add("Cache-Control","max-age=XXXX")

And the client will honor that value.

0 Kudos