Cache

Cache

genshin-kit.js has cached most of responses from the API(except some routes you can check API Reference), so you can use cache instead making a new request.

Note: The key of cache is the UID, cookie or other things you use to make the request.

//...
<ROUTER>.cache.get("key");

Custom Sweeper

You can customize it by passing cacheOptions to the constructor of router.

//...
  cacheOptions: {
    maxSize: 0, // it wouldn't cache anythings
//...