Closed DeepDoge closed 2 years ago
Gonna add more commits under this.
Since we have 2 different API options(maybe more later) to resolve YouTube IDs and they might have different caching headers or no caching headers at all, I told browser to not cache the API request and handled caching using IndexedDB. (Cache time is 1 day)
force-cache
while doing API request they might not expire at all. And API might send bad
or invalid
or null
response that we don't wanna cache forever.LocalStorage
and had many caches, we can't select them by expiry date so we need to go through all of the caches and check expiry date. IndexedDB
let's us index the caches by expiry date which is a more elegant and a better way to find and delete expired values.