cabennett85/gittest — Issue #1043: Remove third party accounts from a page's critical path
Author: cabennett85
Created: 2012-03-02 00:32:18+00:00
State: open

This was a result of probably us not quarantining 3rd party components, so they dont affect our page load. going forward we need to code our 3rd party comps in a way that they minimize affect on our pageload.

this particular bug was a result of FB going down, says neil

Possible solutions (not mutually exclusive):

1. Third party data loads in an AJAX call. In other words, the main page returns immediately and runs javascript that fetches the data in a separate, non-blocking request.

2. Pull and store third party data in a background process (like a cron job) that runs regularly.

3. Cache data in the database. On page load, return cached data. Also, check how old the data is and if it needs refresh simultaneously send an AJAX call to retrieve updated data. When the data is retrieved cache the data in the DB and update the timestamp of that data before returning the data to be shown on the page.

NOTE: Both 2 and 3 can determine how often/whether to pull data in a variety of ways. For example, if the data is a twitter feed, then we can look at the last N feed items, and take the minimum time between adjacent feed items and use that as the threshold for which we pull new data. We can also have a maximum threshold to guarantee some level of freshness.