Make localhost faster?

I am currently working on a project and testing it on my localhost.

I am worried that pages load rather slowly (500-700 ms and not less). I thought that localhost would load faster than any other web page (since it is on my local machine). Therefore, if this is the load time on localhost, will they be much longer when moving my site to a remote server?

As technical details, I am developing a CakePHP environment and have several AJAX requests, all of which take the above load times. Queries should not be time consuming since they load the pages created by CakePHP with MySQL operations that take less than 3 ms (as shown in the frame debugger). I also use XAMPP (hence the Apache web server) on a computer running Windows 7.

Thanks for your answers, and I believe that this post would be useful for others as well.

+6
source share
3 answers

If you say that MySQL is fast, but the slowdown occurs exclusively in PHP, this may help the APC extension. APC caches the output of the PHP parser and performs several other optimizations. Often it can save a ton.

But in general, you will want to do profiling. Use XDebug to get profiling information and use WinCacheGrind to read where everything is slow.

+2
source

You will probably see faster boot times - it is unlikely that your computer will be as powerful as a real server.

Personally, I always wonder how much faster my projects work live, but this may depend on the server. You should download a quick test to ease your anxiety.

+3
source

Also keep in mind that when testing you are likely to use a debug set greater than 0. When greater than 0, your structural structures are not cached, making a cake, reloading them with every request.

+2
source

Source: https://habr.com/ru/post/886314/


All Articles