How can I have a server fetch a JSON file every few seconds?
I have access to a third-party JSON file that contains about 1MB of
real-time information, and the file updates constantly. My website will
display and update this information every few seconds. I can't have the
users access the JSON directly from the source, because my access key will
be revoked for excessive use. So I need to copy the JSON file to a server
every few seconds, and have users get the JSON from that server.
How should I get a server to do this? (I don't have my own server.) CRON
jobs can only run every minute at most. Should I have a shell script make
a copy of this file every x seconds? Can a shell script really run
forever? Maybe I should have a CRON job execute a shell script?
I've also looked at cloud data hosting, but with 1MB being pulled even
just every 20 seconds by each user, I could quickly go through gigabytes
of data transfer, which can cost hundreds of dollars a month with these
services. Unless you know of a data host that's cheaper.
No comments:
Post a Comment