I have a small rails app on Heroku that pulls in my client’s latest Tweet to display on all pages. It is hitting Twitter rate limits already. I’m trying to come up with a solution. Would the following be a sensible approach …
Use a cron gem like Whenever to pull down the latest Tweet every minute and write it to a file, then have pages pull the Tweet from that file instead of directly from Twitter.
Yes, this is one possibility. Or you could use caching to store the tweets, for example using Memcached. This will also make your app faster.