I have written a php code which will get one id from database and using that id it will use some API’s provided by other websites and generate a page.
here my question is where this generated page will occupy the space on the server or on the client machine?
if 10000 people will open the same page then will my server be slow down in this case.
should i store all data for that API in our MySQL-database.
what will make it fast & safe…
Please suggest me…
Thanks
The generated page will occur on the client if you only fetch one id from your database. For this you could first do a jquery.get to fetch id from your server. Next you could get data from other API’s using JSONP(JSON with padding). But for this to work the API’s off course need to support JSONP, because the javascript clients can’t fetch data using jquery.get because of same origin policy, but lucky JSONP can be used for that. Finally you could just easily append data to the DOM using .html. You should be carefull doing this with other API’s and need to be sure these are safe API’s because else you would be vulnerable to XSS. If you are not certain you should use .text instead.
It depends if the API’s do provide JSONP.
Fast
Safe