Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Make getBaseDomain use LRU cache #2682

Closed
bbondy opened this issue Jul 23, 2016 · 2 comments
Closed

Make getBaseDomain use LRU cache #2682

bbondy opened this issue Jul 23, 2016 · 2 comments

Comments

@bbondy
Copy link
Member

bbondy commented Jul 23, 2016

@diracdeltas mentions this function is slow and we call it during filtering so we should be using an LRU cache for the lookups.

@bbondy
Copy link
Member Author

bbondy commented Jul 23, 2016

We use it already in other parts of the code like here:
app/trackingProtection.js:const LRUCache = require('lru_cache/core').LRUCache

@david-gang
Copy link
Contributor

Hi @bbondy ,

It is not clear to me what should be done.
Should the line 198 in the commit 144f786
changed from !refererExceptions.includes(parsedUrl.hostname) to !refererExceptions.includes(getBaseName(parsedUrl.hostname)) and then in getBasName we will implement the lru cache?

@bbondy bbondy closed this as completed in d6ce718 Jul 25, 2016
bbondy added a commit that referenced this issue Jul 25, 2016
Fix #2682: Make getBaseDomain use LRU cache
@luixxiul luixxiul added this to the 0.11.2dev milestone Jul 25, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants