Support

Home Forums Event Espresso Premium Speeding up api call

Speeding up api call

Posted: June 3, 2019 at 8:57 am


rsthrive

June 3, 2019 at 8:57 am

Hi All,

I currently have this api call however, it seems to be causing issues in the sense that the call is taking long time to complete and it also proves to be quite resource intensive on the server. I tried altering the limit value but that has little effect. I wondered if there were any recommendations on alterations to the url? Perhaps something along the lines of only showing upcoming published events? Many thanks


Josh

  • Support Staff

June 3, 2019 at 9:37 am

Limiting the query to only upcoming events will shave just a bit off the time (e.g. add where[Datetime.DTT_EVT_start][>]{current date & time in RFC3339/ISO8601 format}).

The significant slowdown in that query though is the part that requests the category. You’ll find that if you remove the Term_Taxonomy.Term.slug, from the api call, and add the where filter to limit the query to upcoming dates, the response time is cut in half.


rsthrive

June 5, 2019 at 3:09 am

Thanks for your help Josh – very helpful.

I made the change but noticed there was an issue with the time format. My updated call is here but there seems to be an issue with the time format. Did that happen on your end too?

Thanks again


Tony

  • Support Staff

June 5, 2019 at 5:17 am

Hi there,

You’ll need to add an actual date and time to the request, so:

where[Datetime.DTT_EVT_start][>]{current date & time in RFC3339/ISO8601 format}

Would be something like:

https://hardwickhallhotel.co.uk/wp-json/ee/v4.8.36/events?calculate=image_large&include=Term_Taxonomy.Term.slug,Datetime,Datetime.Ticket,Datetime.DTT_EVT_start&order_by%5BDatetime.DTT_EVT_start%5D=DESC&limit=999&where%5BDatetime.DTT_EVT_start%5D%5B%3E%5D=2019-06-05T12:18:30Z

The support post ‘Speeding up api call’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso