N
N
nevesomostjke2021-09-29 20:53:42
PHP
nevesomostjke, 2021-09-29 20:53:42

How to quickly load JSON arrays?

Hello!

Essence:
Suppose there is a foreach array in PHP.
It executes the file_get_contents function 40 to 80 times. Loads JSON data. They are small on their own.

I need to use this array every 5 seconds.
The script is located on a server with VERY fast internet. Average execution time when accessed from a browser: 25.078058004379 (for local understanding, the average script execution is ~127 seconds).

Question:
What are the options to load data faster? Should I use cmd or something else?
Thanks in advance.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Rsa97, 2021-09-29
@nevesomostjke

If these are local JSONs, then keep them in the database.
If they are taken from a remote server, then cache them in the database, periodically loading them there with a separate script.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question