0
votes

Context

We use Podio in combination with Globiflow and Webmerge and it does most of the times exactly what we need but now we start to get to the limits of what is possible with Podio API.

Problem

In a front-end portal we expose podio data to our customers. This gets to be very slow... We did some loadtestings/timings. To be more precise; this call for example takes 20 sec:

\PodioItem::filter(19087964, ['filters' => ['request-sent-to' => [$company->id],],'limit' => 200, 'offset' => 0]);

Question

What can we do to speed it up?

Fyi: We did apply all the standard stuff for reducing API usage and optimizing our calls such as:

  • Avoid making API requests inside loops. Instead of fetching individual objects inside a loop, fetch a collection of objects in one API operation. E.g. filter items
  • Cache results whenever possible. This is especially true when you are displaying data to the public (i.e. every sees the same output).

  • Don't poll for changes. Instead of polling Podio to see if your content has changed use webhooks or push to receive a notification.

  • Use logging to see how many requests you're making

  • Bundle responses with "fields" parameter

1

1 Answers

2
votes

You can try couple more things :)

  1. Add 'remember' => false to your call if you don't need to use same filtered results. 'Remember' flag is causing Podio API to cache filter results which takes time.
  2. Change 'limit' => 200 to something smaller (if you don't actually need all 200 items and only display 30 then don't fetch them).
  3. Limit amount of data returned (Can podio's api filter item response with only a mini detail level for each item?)
  4. Even better would be to cache the results and only request items that have been changed since the last time your script ran. It's quite wasteful to get all items on every run. From your request it looks like you haven't used webhooks yet.
  5. Podio API will not work well as replacement for own DB. If you feel like you are using Podio API when same purpose could be easier achieved by using own database - then your feeling is right. Setup database and move all data that you need to query a lot there, and then setup some sync layer that will work on webhooks and replicate changes from Podio API to your DB.