Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7524501
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T03:06:09+00:00 2026-05-30T03:06:09+00:00

I have a rails application hosted on Heroku using a custom Domain. The application

  • 0

I have a rails application hosted on Heroku using a custom Domain. The application displays the latest Tweet by a single user at the top of each page. To avoid hitting Twitter rate limits (150 requests p/h) I have the application cache the search result in memcache (Dalli) with a 5 minute expiration. This works nicely, ensuring the application only ever makes 12 requests per hour. If it was highly trafficked this solution might be problematic, but as it is I think its fine.

Despite the fact I am well below the rate limits, my site periodically goes down and looking at my server logs it is because I have exceeded Twitter’s rate limits.

Is this something to do with Heroku? What else could be causing it? Is it something to do with shared IP addresses?

Logs:

2012-02-20T22:09:52+00:00 app[web.1]: Rendered pages/home.html.erb within layouts/application (0.8ms)
2012-02-20T22:09:52+00:00 app[web.1]: Rendered layouts/_header.html.erb (336.2ms)
2012-02-20T22:09:52+00:00 app[web.1]: Completed 500 Internal Server Error in 339ms
2012-02-20T22:09:52+00:00 app[web.1]: ActionView::Template::Error (Rate limit exceeded. Clients may not make more than 150 requests per hour.):
2012-02-20T22:09:52+00:00 app[web.1]:     5:             <p class="latest-tweet">
2012-02-20T22:09:52+00:00 app[web.1]: 
2012-02-20T22:09:52+00:00 app[web.1]:     7:                 <% if !latest_tweet%>
2012-02-20T22:09:52+00:00 app[web.1]:     8:                     <% latest_tweet = Twitter.user_timeline("sometwitterusername").first.text %>
2012-02-20T22:09:52+00:00 app[web.1]:     6:                 <% latest_tweet = Rails.cache.read "latest_tweet" %>
2012-02-20T22:09:52+00:00 app[web.1]:     9:                     <% Rails.cache.write("latest_tweet", latest_tweet, :expires_in => 5.minutes) %>
2012-02-20T22:09:52+00:00 app[web.1]:     10:                 <% end %>
2012-02-20T22:09:52+00:00 app[web.1]:     11:                 <%= latest_tweet %>
2012-02-20T22:09:52+00:00 app[web.1]:   app/views/layouts/_header.html.erb:8:in `_app_views_layouts__header_html_erb___4472938277532005844_37037700'
2012-02-20T22:09:52+00:00 app[web.1]:   app/views/layouts/application.html.erb:14:in `_app_views_layouts_application_html_erb__4101970984987800094_41561940'
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T03:06:10+00:00Added an answer on May 30, 2026 at 3:06 am

    Pretty simple. If you share an IP with multiple other developers, you’ll share the rate limits as well.

    I recommend using authentication to raise this to 350 requests per hour, removing the IP-based limits. This’ll simply give you 350 requests, regardless of the developers you share the IP with.

    https://dev.twitter.com/docs/rate-limiting

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a rails application where each user has a separate database. (taking Joel
I have a Rails application, I have the following DB schema: each User has
I have a rails application, and I authenticate users to the application using Devise.
I have two rails applications, hosted on heroku, that need to communicate. For now,
if you have a server with many rails applications hosted on it, and each
I have rails application that connects to multiple databases. I wrote custom rake task
I have a Rails application with a FFI binding to a custom RPC system.
I have multiple rails application running at a server. Each one at one port
I have a Ruby application (not using Rails) that use my own Ruby gems.
I have a rails application that displays content that is being rendered as a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.