So. I have a data table in a MySQL database, for example:
- Artist Name
- Artist Biography
- Artist Age
let's say for example: 100 artists.
Since this data will be changed very rarely, I created an interface in which, when the data is changed by the administrator using the content management system, the system queries the database and saves the serialized PHP data array as a file on the server.
This file is recreated every time a new artist is added, they say once a week.
In the interface, when the page is loaded instead of querying the database, the page simply includes the file (using output buffering) and creates an HTML page layout from this object.
Is that a good idea? Will it be faster than hundreds of users requesting a database every time a page loads?
As a complement to this question, if I start to print data, for example. set the limit for the MYSQL result object to 10 rows, will it be slower to access the entire table as a PHP array and reduce this to groups of 10 - repeat the corresponding section based on the query string?
source
share