I too would appreciate someone from Twitter giving us a best practice here. I'd prefer not to cache images locally (lazy) and only store the url. But how does the company feel about paying for bandwidth if I just request user images from the S3 URL in third-party apps?
On Jan 8, 10:23 am, "greg schoen" <[email protected]> wrote: > It's is good practice to both save the profile_image_url data from the > API and save the image locally. This way, if the profile_image_url > changes, you have a trigger to recache the image to your local site. I > find that page loads are much faster when you can control the images > that come through. > > A good example is that, since Twitter allows avatar images of up to > 700k, you may find that a user has saved a 600k animated JPG file, > that you might want to convert to a static non-animated version. 700k > can spike your traffic, if it's taking up more than all the other > images combined. > > Maybe Alex can answer this, but is Twitter going to be clamping down > on avatar images? 700k just seems excessive, when the average is 2k > and under. > > -Greg > > > > On Thu, Jan 8, 2009 at 1:12 AM, Patrick Minton <[email protected]> wrote: > > > Well, I am querying to update user stats (# of followers, location, > > etc), mostly because the app "ranks" the lawyers, and lawyers are a > > ridiculously competitive bunch that find it beyond cool that they get > > ranked. > > > So since I have the user object, might as well update the URL field in > > my DB too, right? > > > On Jan 7, 2009, at 2:57 PM, Stuart wrote: > > >> 2009/1/7 Patrick Minton <[email protected]>: > >>> Since you get user objects 100 at a time, you would have to query > >>> about an unreasonable number of users for this to be a problem imho. > > >>> Lextweet.com follows about 700 lawyers. This may grow to 2000. 20 > >>> API calls an hour is a problem for the API? I doubt it. If it is, > >>> though, I'd be more than happy to reduce the frequency. > > >> My point was that there's no need to hit the API at all unless you get > >> a 404 from the avatar URL. Why call the API if you don't need to? > >> Seems like a pointless waste of resources to me. > > >> -Stuart > > >> -- > >>http://stut.net/ > > >>> On Jan 7, 2009, at 1:45 AM, Stuart wrote: > > >>>> 2009/1/7 Patrick Minton <[email protected]>: > >>>>> Yes, but once you have the url, why store the actual .png locally? > >>>>> Sure, if a user changes their profile image you may have a broken > >>>>> link, but > >>>>> you can update profile info every hour or so, thus making it a non- > >>>>> issue. > > >>>> I don't think Twitter would see it as a non-issue if your service > >>>> has > >>>> more than a few users and you start requesting their details every > >>>> hour. A better option is to attempt to download their avatar and > >>>> only > >>>> request their profile and update it if you get a 404. > > >>>> -Stuart > > >>>> -- > >>>>http://stut.net/ > > >>> Patrick Minton > >>> IT Director > >>> LexBlog, Inc. > >>> +1 206 697 4548 > > > Patrick Minton > > IT Director > > LexBlog, Inc. > > +1 206 697 4548 > > -- > [email protected] > 920.941.0399
