I have an api to get some data (limit every 1 minute call) in JSON format and I want that api to be available for all those users who has the access to the server.
I had a php code getting the contents from api then using that JSON
object in javascript file. But if multiple users go on the website, the api is called multiple times every minute, so only 1 guy gets the data, and the others don't.
Is there a good solution to something like this?
I try to save the JSON
object into a remote file then everyone who accesses the website reads the JSON
file which changes every minute but for some reason on the remote server the JSON
file isn't being updated every minute. Is it a permission problem?
In php file I use "file_get_contents"
to get json from rest api.
then I save the data: "file_put_contents"
Is there a different solution of getting the JSON data (updated every 1 minute) to everyone who accesses the website available to use in the javascript file?
How to save json data to remote file every one minute?