JonathanGarro / SIMS-Portal

IFRC Surge Information Management Support Portal
4 stars 4 forks source link

Add caching on Trello API call #27

Closed JonathanGarro closed 3 months ago

JonathanGarro commented 1 year ago

In looking through the logs, I'm realizing that the call to Trello on page load when viewing emergency records is unnecessary. Let's add flask-cache decorator to that page view function and store Trello data for a set period of time to limit the pings.

JonathanGarro commented 1 year ago

Investigated this a bit and realized this will require a rebuild of a few elements in the emergencies route. I created a helper function in the emergencies' utility file that takes in the trello URL and returns the data from the API. The problem is that caching in the way I've structured this means it would cache for the last emergency for which a user accessed that route, not just the one someone is looking at, meaning you might get the wrong board's data on a given emergency.

JonathanGarro commented 3 months ago

OBE once we shifted to GitHub projects.