How big is the difference between xyz.cache.get() and await xzy.fetch()?
fetch returns the cached thing aswell if it exists, so except the Promise difference i see not really a problem with using await fetch all the time. Is this consider bad practise? & How big is the difference time & performancewise?
5 Replies
Should be negligible in both terms and I don't think it's a bad practice... cause it will check from cache first and if not found in cache then it will fetch it(unless you are force fetching)
in some scenarios you’ll better off using fetch
like if so a member hasn’t send a msg or smth
sometimes that isn’t in cache
afaik anyway
what is the „downside“ of using fetch? if there is one
I haven’t had any issues with it from my usage
you cannot use fetch without async
that can be an issue in some situations