Php browser cache solution for high concurrency

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.