PHP Session optimized Source _php tutorial

Source: Internet
Author: User

PHP Session optimized source code


PHP session the same client request when the server session does not end, the next request cannot be done!

For example, the following code:

Client















Server

Session_Start ();
Sleep (2);
Echo ' {json: ' repsonse '. $_get["Call"]. '"}';
?>

The above client loading takes 10S more time.

The session can be used Session_write_close (); Close, the next request can be executed immediately!

Cases:

Session_Start ();
Session_write_close ();
Sleep (2);
Echo ' {json: ' repsonse '. $_get["Call"]. '"}';
?>

The above code client load time reduced from 10s to 2s time!

http://www.bkjia.com/PHPjc/853762.html www.bkjia.com true http://www.bkjia.com/PHPjc/853762.html techarticle PHP session to optimize the source PHP session of the same client request when the server session does not end, the next request cannot be done! For example the following code: client:html head meta http-equiv=content-ty ...

  • 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.