3

We use PAC file to automaticly select proxys, and it is very often for us to store a big table (whitelist or blacklist) in the PAC file.

I'm wondering, how the PAC file is used, and is it possible to preprocess the big table once and keep the processed data structure reused for every following query.

I have read the doc from mozilla but it tells nothing about my question.

And I have also read some articles about best practice of PAC, and it tells to "Keep the file as small and efficient as possible", but how can we keep the PAC file small when we indeed need a big table?

luochen1990
  • 3,689
  • 1
  • 22
  • 37
  • I'm not really sure your question is a good one for stackoverflow. Although it sounds pretty interesting. I don't get your exact problem though: What do you mean by preprocess big table once? What is the problem? Performance issues? How does the code look like? – Danmoreng Nov 23 '19 at 11:51
  • @Danmoreng look at [this pac file]( https://github.com/breakwa11/gfw_whitelist/blob/master/whitelist.pac) for example, it contains a big table, and if I want to add a preprocess pass of this big table, I don't want it to be executed every time when I visit a website. – luochen1990 Nov 25 '19 at 03:03
  • I don't quite understand what you mean by a "preprocess pass" of the table? Of course the check if the called domain is in the whitelist or not has to be done every time? The only performance improvement which comes to my mind here is something I watched very recently: using JSON.parse for the data: https://www.youtube.com/watch?v=ff4fgQxPaO0 – Danmoreng Nov 25 '19 at 14:59
  • @Danmoreng Such as, build a Tree for faster search, instead of using plain list. – luochen1990 Nov 26 '19 at 11:00

0 Answers0