PHP Speed Test for user connection speed without echo in current page

后端 未结 7 1212
甜味超标
甜味超标 2021-01-13 00:25

I am looking for a possibility to check the user connection speed. It is supposed to be saved as a cookie and javascript files as well as css files will be adapted if the sp

7条回答
  •  青春惊慌失措
    2021-01-13 01:14

    Do you have any solution?

    My solution is to not bother with the speed test at all. Here's why:

    You stated that the reason for the test is to determine which JS/CSS files to send. You have to keep in mind that browsers will cache these files after the first download (so long as they haven't been modified). So in effect, you are sending 256K of test data to determine if you should send, say, an additional 512K?

    Just send the data and it will be cached. Unless you have MBs of JS/CSS (in which case you need a site redesign, not a speed test) the download time will be doable. Speed tests should be reserved for things such as streaming video and the like.

提交回复
热议问题