You are viewing a single comment's thread from:

RE: My First Steem.js Adventure, Part 4: Fixing My API Timeout Bug & Finishing Up!

in #steemdev7 years ago

Nice post!
Wouldn't it be possible to cache the requests with service worker + cache storage? It could save you a lot of time if the request was already sent any time in the past :)

Sort:  

Thanks so much for reading and offering advice! I was really hoping to get some tips on how to improve what I did 🙂

I've actually never used service worker before. Would it know if a request would return the same results or not? For example, if the user had submitted a search that included the current day, which still had some transactions, would the search know not to return those same results if the user searched the same range sometime in the future? Sorry if that's confusing!

I guess I'll just have to look into it and see if I can use it to improve my little app. Thanks again!

You're welcome 🙂
The possibilities how to implement it in detail are endless. The CacheStorage works totally dynamic so you could decide every request if to cache or not. There are also different caching strategies: have a look here.
Kinda impractical that my post about Service Workers and CacheStorage is only in German 😅

Awesome, thanks for sharing! Haha no worries, maybe I can try using google translate on your post 😀

Coin Marketplace

STEEM 0.17
TRX 0.13
JST 0.027
BTC 60340.89
ETH 2615.66
USDT 1.00
SBD 2.56