c# - Advice on image storing -
i developing app browse(and more things, not relevant) youtube lists. whenever video, display it's corresponding image , show in listview (or gridview, again not relevant). here dilemma: better store images locally after downloaded, or download them every time want them showed, i.e:
this._image = new bitmapimage(new uri("http://domain.com/content/someimage.jpg"));
you're going want see youtube has on matter; i'm sure it's got regarding in developer api documentation note preferred approach it.
that said, take general advice; when you're querying system, want limit how annoying are. now, youtube's not going notice load of 1 app, of course, it's still habit keep. speaking, i'd prefer split difference: cache image based on video id , hold x hours, if user pulls same video in search 20 times didn't request thumbnail 20 times well.
that way keep result relevant updating image every day or 2 (assuming searched video again).
edit: right, app. mobile. bandwidth. godawful data caps. advice more important , probably want make cache couple of days safe, have hard cap of how many video thumbnails keep @ time you're not app taking 100mb of space on guy's 8gb phone.
if want super user friendly, throw in settings somewhere let people change approach query every time, or cache specific time.
Comments
Post a Comment