I am currently building a PHP framework (original, I know) and work on some optimization features for it I am doing What is the best way to cache MySQL results in a dilemma that I have come across? I know that some people will say, first optimize your MySQL etc., but ask for logic, my query has been optimized for 1 minute and as possible.
What is the best way to cache PHP results, so I do not need to run the query for each page load again?
My first thought was that the result was loop through, adding them to an array ... serialize them and then store them in a file. Now there is only one time in the form of cache, I can tolerate the upper part of the serialize function if there are 1 million results in the array. When loading the cache file and then unassigning the array on every paglod, it could have an effect.
Would it be a better idea on caching, instead of sorting the results and writing the file in a manner that displays the results in a PHP readable array. So, when it loads, there is no uncertainty.
Is there anyone else (Read: fast) ways to use slow query cache often for use?
If this is a direct array, then you can use it instead of serialize (with appropriate Wrap it up in the .php file; Your script is best done if you can write it out of htdocs tree, and only really useful for large volumes of data that will consider memory cache excessive. < / Div>
Comments
Post a Comment