Web application using PHP and SQL Server, if the train feelin 'the most part considering that the query statement. Connectors and Speed in a relationship, the hardware limitations of the software processing soken Jack
Does not come through a massive traffic typically occurs if the page direct queries to extract data. We'd like to explain the graphic, stick, briefly describe the relationship does not have a graphical tool
WebClient ---> WebServer ---> SQLServer (down)
WebClient <---- WebServer Return <--- SQLServer Return
Webserver php parser and code after interpreting data to SQLServer as above, by sorting the request, and html format response to a Web client makes.
Inefficient days As will vary depending on the purpose of implementation, as a bulletin board and real-time output to form haejwoya unless guess.
Therefore, the cache stores dynamic finishes processing the file, as shown below.
Not parsing php in cooperation with the data to SQL without having to ask any visitor has a number between 5 minutes without a web server just read the cached file and output haejumyeon'll.
Server load and speed is of course faster.
Save the file, so to speak, one that would update in 5 minutes.
1 visitor 1 minute rachimyeon thousand, five thousand of events is fucking'd once
(?
$ Reqfilename = "index";
$ Cachefile "cache /" $ reqfilename. Xanadu ";
$ Cachetime = 5 * 60; / / 5 minutes
/ / Serve from the cache if it is younger than $ cachetime
if (file_exists ($ cachefile) && (time () - $ cachetime <filemtime ($ cachefile))) {
include ($ cachefile);
echo "<! - Cached". date ('jS FYH: i', filemtime ($ cachefile)). "-> \ n";
exit;
}
/ / Start the output buffer
ob_start ();
?)
Here is Page-Content home
(?
$ Fp = fopen ($ cachefile, 'w'); / / open the cache file for writing
fwrite ($ fp, ob_get_contents ()); / / save the contents of output buffer to the file
fclose ($ fp); / / close the file
/ / Send the output to the browser
ob_end_flush ();
?)
No comments:
Post a Comment