Here's an API server which can give me real time news: every minute there will be something new to retrieve. There's also my web page, with a Javascript that will ask the API to get some news once every minute.
And this is not fine... unless my web page is made for a single user and will be open only on one machine at a time (which is not the case of the internet). the API, infact, restricts the number of call I can do per minute: let's suppose the API will ban me if I do more than 1 call per minute. If 100 users will load my web page, the API will receive 100 calls per minute (!!!).
Since the flow is my web page >> calls >> the API I think there is no solution without inserting another node which lazy loads from the api server.
my web page >> calls >> my server >> calls every minute >> the API
Since the instances of my web page may be many while my server is just one I think this is the solution.
However, I have no idea if:
a) is this the correct solution? Or could I somehow get my web page to behave correctly without the need of an intermediary server?
b) how can I implement this in ASP.NET MVC4? Is there any support for server side timers?
c) even if I can get IIS to retrieve the data every minute, should I then store it in a database to serve it to my web page?
d) the api server I'm talking about is The Times Newswire API. If anyone ever used a similar API, did you really created a domain model, a database table, a service and a routine just to retrieve data from it or did you just writed some javascript code in my web page? What then if you have milions of users?