Monday, August 18, 2008

Rate limit in Web 2.0 API

Many public API's from Web 2.0 projects introduce rate limits for the usage. E.g. Twitter API allows 70 requests per hour, Google geocode API does the similar things etc.
Let us see the following component in Coldtags suite: Timer taglib. Body tag timer may execute own body once per given time interval (or not often than - depends on the incoming requests) for all the requests (application scope) or on per user base (session scope). Beyond the cache, we can use this tag for dealing with the rate limitation in public API. E.g. ask Twitter not often than once per 60 seconds:

<t:timer interval="60">
    code for Twitter API
</t:timer>

No comments: