FosisApps/FosisHome — Issue #1: Use caching at model level of tweets retrieved
Author: iotmani
Created: 2011-12-31 23:15:54+00:00
State: open

Keep a local representation of hadiths in the following way:

* Use an array of hadith containers, sorted by Id for optimised fetching of next and previous.
* getPrevious(id)
* if hit edge of local cache of hadiths, get 20 more with 'max_id' being latest id.
* getNext(id)
* Uses the same cache as getLatestHadith, it can trigger fetching the latest from twitter if cache miss.
* getLatest() once fetching cache expires:
- Get 'since_id' being local representation of latest id, add result(s) being one or more if any new ones in Twitter and return latest.