Does it make a difference to read from a file instead of from MySQL?
- by Joe Huang
My web server currently is quite loaded. And I have a PHP file that is accessed very often remotely. The PHP file basically makes a MySQL query and returns a JSON formatted string.
I am thinking to use a Cron job to write the necessary data into a file every 15 mins, so the PHP file doesn't make a MySQL query, instead it reads from the file.
Does it make a difference? I mean to alleviate the server loading (CPU/MySQL) a bit?