My localhost rendering pages were slow. All simple html rendering took about 2-5 seconds. I examined it and fixed it by replacing:
new \PDO(... ':host=localhost' ...);
to
new \PDO(... ':host=127.0.0.1' ...);
can someone explain to me or give me a link to find out why localhost is slowing down and how just changing it in the IP system has become very fast. Now he makes even complex queries in less than a second, when he took about 5-10 seconds earlier.
And is there also a security issue replacing localhost with IP? I mean, if I take my project live and I replace localhost with the host IP, will this affect any security?
thanks alot
source
share