microlinkhq / metascraper

Get unified metadata from websites using Open Graph, Microdata, RDFa, Twitter Cards, JSON-LD, HTML, and more.
https://metascraper.js.org
MIT License
2.35k stars 168 forks source link

perf(logo-favicon): memoize urls resolution #512

Closed Kikobeats closed 2 years ago

Kikobeats commented 2 years ago

Using a function memoizer. This is a necessary thing in this case because http agent only cache succesful/redirect responses.

In this very particular cases, the most common scenario is favicon is missing (404).

Since keyv doesn't store undefined, in that case we convert it to null and then back to undefined.