Closed GeoffreyPlitt closed 6 years ago
Great ideas. What flash does: It first tries to find the image file in /tmp where it gets extracted. See https://github.com/hypriot/flash/blob/58c68b0067f197c9641947bb2f7bedf9cd202a24/flash#L495-L500 It's a "better than nothing" kind of cache without all these fancy stuff. If we want to support cache better then new questions arise, who big should this cache be, ...
Shoot, I should have noticed that-- it sounds great, nothing more needed!
Actually, the /tmp cache doesn't seem to be working.
I just flashed a Pi successfully with sudo flash --force https://downloads.raspberrypi.org/raspbian_lite_latest
Inserted a new card, did it again, it downloaded the OS again instead of using /tmp.
Thoughts?
The simple cache doesn't work with download links that use a different name than the extracted img file. Look inside /tmp. You can use that /tmp/xxxx name for further flashes or send me a PR to fix it :-)
Oh duh. I can use a more specific URL, the one above is likely a redirect. Thanks again.
Love the http syntax, but does it download fresh every time? Could it use LastModified or ETAGs or some other http technique to avoid downloading the second time, and use local copy?