Open chrismaliszewski opened 5 years ago
So it would not be only caching data, but also storing the picture permanently. We would need a mechanism to make sure the file has not been updated online. I know you can do this with HTTP headers for cache system, but it's not perfect in my opinion.
Now another point on this : it depends what is your priority : saving disk space, or saving mobile data ? I would say disk space, because I'm using WiFi, and my 4G is unlimited but it will depend on every country I guess.
I'm curious to know what you guys would prefer : taking disk space, or saving data?
Just to be more precise:
taking disk space by saving images permanently on the user's machine, saving mobile data and speeding-up rendering of SE's images VS saving disk space and lazy loading SE's images which will be cached only temporary
I'm not sure it would take less time, as we would need to check on server side if the file is updated anyway. Or we can do this in parallel but it get overly complicated for just such a small optimization.
Question: does changing a scenario's image modify its version in the https://drive.google.com/file/d/13JEtzRQ1LcCAAhKluxii0tgKDW71XODV/view kind of a file?
Again, you're right. The change will not speed-up SE but the downloading/rendering the images.
So the question is the one you asked, which is: "Do you prefer saving mobile data and storing images on your machine or saving your storage space?" Let's way for others' opinions.
I personally think data is more of a commodity than disk space. We are talking about at present 30 x 50kb files. Assuming all the files are around the 200x200px mark, it's going to take hundreds of image files to consume even 1% of modern devices.
The added bonus to local load is that you'll always get a consistent experience when running the SE.
I've noticed that on the train or in poor 4g areas the SE seems sluggish and awkward. I assume this is the image download happening.
My point is, a menu like that should be smooth to the end user. If they then download a scenario and the loading bar is slow, they wont care since that's what a loading bar is for. If they open SE and its jumpy they'll assume it's bad coding.
Cache it and only update the image, when the scenario version changes.
Originally posted by @BenRQ in https://github.com/NPBruce/valkyrie/issues/1128#issuecomment-476907721
Agree that caching, is not a big problem and it can wait especially since images are loaded after the SE list is created what doesn't prevent a user from working. The only big(?) issue with caching is wasting a transfer for mobile.
Still, I'd urge to save the images on the client's side for faster work and saving data.
Each scenario has only one image so everything will be fine. Images could be named after... scenario's version (without "-" symbols).
The only problem with the idea: the old images are left behind. Therefore, there could a method running in the background after SE is fully loaded which would delete the rest of images unused.