educative.io

Why LRU cache to store hot URLs?

As newly created URL, will be used/opened/read only once generally and this new created URL can evict hot URL (getting used by many users) from the cache.

2 Likes

Answer: Newly created URL should be cached to provide better experience for new urls.

When the cache is full with hot URLs, is it required to remove the existing one with the new URL ?
Isn’t it better to first check the frequency of least recently used before replacing it with the new one ?