user1642579
user1642579

Reputation: 95

Caching images for a Middleman site

I have a Middleman app deployed to GitHub pages. The app hits the Twitter API (GET users/show) every time a user visits the homepage to display our team. The Twitter API is rate limited (and I'm sure this is poor practice anyway) so, if there is a large number of visitors in an hour, the team comes up empty.

If this were a Rails app, caching the images to the server regularly would be fairly straightforward but how would you do this for a static site? Could you cache the images to an external service once per day or something?

Upvotes: 2

Views: 237

Answers (1)

iced
iced

Reputation: 1572

You can have some cronjob for this task which will fetch data from twitter and, for example, generate html or some other kind of media and upload it to github.

Actually, you might want to check IronWorker for that job, so you'll don't need your own server and with few-fetches-per-day load it'll be free for you.

Upvotes: 2

Related Questions