Hi, I have a question about append_to_response Performance
https://api.themoviedb.org/3/movie/157336?api_key={api_key}&append_to_response=videos,images
VS
/movie/{movie_id}
/movie/{movie_id}/videos
/movie/{movie_id}/images
I have a mobile app, as you scroll down it request more details, videos, images individually.
I'm planning to use this append_to_response
.
My question is in terms of waiting time is it the same with individual request?
Example:
Individual request:
get Detail request = 1 second
get Images request = 1 second
get Video request = 1 second
==
`append_to_response` [Detail, images, videos] = 3 seconds
Can't find a movie or TV show? Login to create it.
Want to rate or add this item to a list?
Not a member?
Reply by ticao2 š§š· pt-BR
on September 14, 2020 at 10:14 PM
The best person to answer your question is Travis Bell.
He is the creator and manager of TMDb. But I think you're on vacation.
I am not a programmer. So excuse my intrusion.
But I think I can help.
First look at this link for the response time for an API Request, which will only send data.
Including the necessary data, image paths and video IDs.
TMDb Service Status https://status.themoviedb.org/
The response time for my location is:
In a more basic API Request
https://api.themoviedb.org/3/movie/157336?api_key=THE_KEY
you already receive the Path of the Main Poster and Backdrop.
So I believe that the first API Request may already be the complete one you gave as an example.
https://api.themoviedb.org/3/movie/157336?api_key=THE_KEY&append_to_response=videos,images
You can receive the path of all images and use the paths to request the images themselves.
I'm not sure but I think it's time for 1 image.
As for the video, you will receive the Vimeo and/or Youtube ID.
I don't know what the response time is.
Reply by Jaymart
on September 15, 2020 at 12:08 AM
http://api.themoviedb.org/3/movie/157336?append_to_response=videos,images,reviews,credits,similar
= 464msVS
http://api.themoviedb.org/3/movie/157336
= 360msSo if I'm displaying all the details it is better to use
append_to_response
to improve the user experience? :)Reply by Jaymart
on September 15, 2020 at 12:13 AM
let's also wait for Travis Bell for his opinion :)
Reply by Travis Bell
on September 19, 2020 at 12:29 PM
In your example above,
append_to_response
is certainly the way to go. You will not be able to request the videos, images, reviews, credits and similar items within 464ms. Get details is 360ms all by itself. Withappend_to_response
, that's 1 request over the wire for all 6 methods at a cost of only 100ms.