cgi generated autoconfig files

It is possible to associate the .pac extension with a cgi program on most web servers. A program could then generate an autoconfig script depending on the source address of the request. Since the autconfig file is only loaded on startup (or when the autoconfig refresh button is pressed) the slight delay due to a cgi program would not be noticeable to the user. Most large ISPs allocate subnets to regions, so a browser could be configured to access the nearest cache by looking at the source address of the request to the cgi program.