I am creating an application and I am trying to figure out what is the best way to download json files.
One approach I'm considering is php include
var jsonFile = <?php echo include "jsonFile.json";?>; var jsonFile_2 = <?php echo include "jsonFile2.json";?>;
or better is ajax?
$.ajax({ type: "GET", url: "jsonFile.json", dataType: "json", success: function () {
Or maybe a mixture of the two?
There are 3 json files that will be downloaded at the moment. One of the files will grow over time and is unique for each user, the second is a static file, and the third is a large data file. The second and third files will be available to all users.
What is the best way to maintain efficiency and good performance with high user growth over time? Do I have to worry about anything specific with php or javascript ajax when users 1000, 10000 or 1,000,000 access the same file at the same time? Is there any other approach that should be taken?
Thanks for all the tips / suggestions and different approaches.
source share