Updating my website - is there a better approach?

I have a website that shows me something from Google (just playing mostly).

I use python-flaskfor my site, it manages the REST API calls and returns them. Subsequently, I “print” the information on my website using javascript.

Now, in mine js, I call my own site every 5 seconds, so a new REST API call is launched in python to update my data. Is there a better approach? I still want to use the REST API.

+4
source share
1 answer

If you want to limit the amount of traffic that will come from your site, you can get the data in advance from the REST API, save it in the database and then serve only its users.

enter image description here

This, of course, only works if all users receive the same data (independent of the user).

0
source

All Articles