PolicyStat/GitZen — pull request #8 by FriedRice (2012-06-15 16:37:53+00:00)
Title: gz-5: Reduced load time of home page so that it will load on Heroku

After fixing the API calls in the application so that they gathered all of the tickets from Zendesk and GitHub, the app became extremely slow because it took a large number of http requests to gather all of this data from each website. In order for the app to run successfully on Heroku's servers, it must be able to load the home page in under 30 seconds, and because of these requests, the application could not load fast enough.

My solution to this problem was to limit the API calls to only gathering data from the last 6 months in order to cut out a large portion of the data requested from each website. Any data older than 6 months will probably not be useful in the app, so it should not be much of a loss excluding it. After testing, I confirmed that these limits allow the home page to load fast enough to run on Heroku.

An issue with this solution is that it requires me to hard-code the page number to start the Zendesk ticket API calls on based off looking at the data returned by these calls. This is the only way I could filter the requests to the Zendesk API by date. I could ask the user to find this information and store it under their account, but it is a rather annoying piece of information to find, so that may not be a feasible solution. Either way, I will probably have to address this issue sometime in the future.