简体   繁体   中英

API Call Is Extremely Slow Server Side on GAE but Fast Browser Side

I just have a simple question here. I'm making a total of 10 calls to the Twitch TV API and indexing them, which is rather slow (15 seconds - 25 seconds slow).

Whenever I make these calls browser side (ie throw them into my url), they load rather quickly. Since I am coding in python, is there any way I could fetch/index multiple URL's using say, jinja2?

If not, is there anything else I could do?

Thank you!

If you don't expect them to change constantly, you can cache the results in memcache and only hit the real API when necessary.

On top of that, if you think that the API calls are predictable, you can do this using a backend, and memcache the results (basically scraping), so that users can get at the cached results rather than having to hit the real API.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM