Closed Irev-Dev closed 6 years ago
Unfortunately localStorage cant handle storing that type of data. You can cache the fetch request with the browsers cache API. Have a look at my pull request and let me know if it works for you!
Resolved in #29 & #30.
Thanks @mkeeneth @mkeeneth, this significantly improves the experience visiting for a second time. I'm also learning a lot π
If you've visited the website, you'll know it takes a while to load, this is because it's fetching about 20mb of MRI data before it can display it (and I don't think openneuro.org's servers are very speedy). It would be good if we could store the last viewed MRI data in local storage so that it can be pulled up if a user re-visits the site.
If it's any help below is a little bit of hacking I did to see if I could get it working and I couldn't π€·ββοΈ . At the bottom of
setupNifti
I'm storing the data, and trying to do so efficiently since it's a sizable chunk, then at the top ofsetupNifti
I'm trying to load it in (so the second time you visit you can access this) just trying to log things out for now, if was working, then loading from local storage wouldn't be insetupNifti
. Anyway when I log outblob
I get[object object]
π .