Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This is actually kind of neat. The image is updated upon request right? Are you caching at all?


Sorta :) 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.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: