دعم الموقع

I am writing an application in Perl to display movies released in the last week. I have the code working, but it's slow. I call the API with discover/movie to get all the newly released movies, and then call the API with movie/{id}/releases for each of the movies so I can extract only movies with US releases. This code takes about 10 seconds. Then I call the API with movie/{id} to get basic information about each of the movies. This portion takes about 13 seconds. So, to get a complete list of US-released movies for one week takes about 23 seconds (depending on how many movies were released that week). This is obviously slow. If I want to use the API for this purpose, is it expected that I write code to download the entire database, update the data periodically, and access the data locally?

1 رد (على هذه الصفحة 1 من 1)

Jump to last post

Hi celiao,

A few things.

Use ?append_to_response so you only have to make the movie call with releases once. That's half as many calls as you're currently making.

Depending on the way the interface works, most people don't go and query every page of the discover results. Most UI's might only show 10 items at a time, so you can only grab the first page and as the user scrolls be loading more pages behind the scene. This way you're only grabbing 20 items at a time. For examples of this depending what platform you're on, there's a number of apps you can see who have implemented something like that on our apps page.

We let you do approximately 3 requests per second so you can do multiple requests at a time if you spun up concurrent requests.

Depends what you're trying to build. Lots of apps just query our DB directly while others are doing a lot more custom things that require their own DB.

لم تجد الفلم أو المسلسل ؟ سجل دخولك و انشئها

عام

s ركز شريط البحث
p افتح قائمة الملف الشخصي
esc اغلق النافذة المفتوحة
? افتح نافذة اختصارات لوحة المفاتيح

على كافة صفحات الوسائط

b ارجع للخلف (او للصفحة الام عند التطبيق)
e انتقل لصفحة التعديل

على كافة صفحات موسم المسلسل

(السهم الايمن) انتقل للموسم التالي
(السهم الايسر) انتقل للموسم السابق

على كافة صفحات حلقة المسلسل

(السهم الايمن) انتقل للحلقة التالية
(السهم الايسر) انتقل للحلقة السابقة

على كافة صفحات الصور

a افتح صفحة اضافة الصورة

على كافة صفحات التعديل

t افتح محدد الترجمة
ctrl+ s ارسال النموذج

على صفحات المناقشة

n انشى نقاش جديد
w تبديل حالة المتابعة
p تبديل عام / خاص
c تبديل اغلاق / فتح
a افتح الانشطة
r رد على النقاش
l انتقل لأخر رد
ctrl+ enter أرسل رسالتك
(السهم الايمن) الصفحة التالية
(السهم الايسر) الصفحة السابقة

الاعدادات

هل تريد تقييم او اضافة هذا العنصر للقائمة؟

تسجيل الدخول