2 Replies Latest reply: Jul 26, 2013 6:35 AM by eelsasser RSS

    PAC File Caching?

    feickholt

      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

        • 1. Re: PAC File Caching?
          tyger

          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

          • 2. Re: PAC File Caching?
            eelsasser

            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.