2 ms·
This is actually kind of neat. The image is updated upon request right? Are you caching at all?
by omouse 18y ago
This is actually kind of neat. The image is updated upon request right? Are you caching at all?
- aupajo 18y agoSorta :) The biggest slowdowns are the generation of the image and the Twitter request. When an image is (successfully) generated, it's written to a file. The next time you query that user, it'll return that file unless it's been longer than a certain amount of time (currently set to 15 minutes). If it has been, a request is made to Twitter. If they've updated their message, a new image is generated, otherwise the stored file is used. The time between updates is stored in a single handy constant that I can alter to adjust for bandwidth.