Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
If we are talking about file_get_contents() with reading data from the URL, and not from a local file, then the easiest option is to save the read data to a local file. Local files are a great caching option.
If you need to keep track of the data lifetime, you can focus on the file modification timestamp - filemtime().
It is highly desirable to use a flock on this file so that several threads do not write to it at the same time.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question