Why not use more modern regex tools?

Evaluate regexes and cache the result per client and domain.

No, there is no need for a timeout as any chance possibly resulting in a change flushes the cache.

Adding/removing domains from the lists, a gravity update or changing groups associated with either clients or domains - everything that could cause a domain's blocking status to change. Pi-hole implements selective flushing per client so small changes do not reset everything.

See @jfb's answer.


edit To expand on this very incomplete statement:

is more about Pi-hole being so extremely fast with exact lookups as it is using a B-tree algorithm for its lookups. This all has been explain very often on this forum, see e.g., here for details about the particular why:

very short: one million regex will take several seconds to evaluate, one million domains will take less than a millisecond to evaluate. Having two million domains and 500 regex is probably fine, the other way around surely is not. This general statement wouldn't change too much even when the regex engine would be three times faster.

1 Like