Php browser cache solves high concurrency I write a cache in the page header like this, & lt ;? Php & nbsp; $ cache_time & nbsp; = & nbsp; 60*10; & nbsp; // 10 minute cache $ modified_time & nbsp; = & nbsp; @ $ _ SERVER ['http _ IF_MODIFIED _ php browser cache solves high concurrency
I wrote a cache in the header of the page,
$ Cache_time = 60*10; // cache in 10 minutes
$ Modified_time = @ $ _ SERVER ['http _ IF_MODIFIED_SINCE '];
If (strtotime ($ modified_time) + $ cache_time> time ()){
Header ("HTTP/1.1 304 ");
Exit;
}
Header ("Last-Modified:". gmdate ("D, d m y h: I: s", time (). "GMT ");
Echo"
";
Echo date ('Y-m-d H: I: S', time ());
?>
Question 1:
The browser will only retrieve data from the browser within 10 minutes;
Question 2:
If the database data is updated, the dynamic page is not a dynamic page, and the browser is still reading the page. How can we perform page updates and cache re-start computing? Is there any way to change the cache and start again?
Online request and answer!
How do we solve high concurrency problems? Share: More