
Loading…
Cosmetic filter cache: convert watermark-based pruning trigger to time-based pruning trigger #438
gorhill
commented
gorhill
commented
Actually a sort of combination of both approach would probably be optimal: prune obsolete entries at regular interval, except never throw out the remaining n most recently used entries.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Currently pruning is triggered using watermarks, with completely arbitrary watermark figures (75-100). The amount of cached CSS selector probably ends up being over the top, hence occupying memory pointlessly.
Using a time interval to trigger pruning makes more sense, given the cosmetic filter cache is useful mostly for when browsing web pages on a specific site withing a set time span. It's just a matter of picking after how long of not being used a cache entry should be considered obsolete.