Accessing WordPress page for the first time took about 5-7s to load from a local server vs 300-500ms for subsequent page loads on any links. Approximately 10x slower for first time access which is unacceptable. Browser cache is disabled in developer tools. How to fix?
I noticed that whenever I access a wordpress page for the first time (like cleared everything in chrome) that page I am accessing took about 5-7s to load considering that this is a local server, that load time is unacceptable. However, after that first time load, subsequent page access just took only about 0.3-0.5s or 300-500ms (still long for local server but order of magnitude faster than the first time load). To eliminate the cache issue, I disabled it from browser developer tools, so all page requests, regardless of first time or subsequent, accesses web files directly from the server.
Test done so far
At first I though It was a server Issue, and then I transferred to localhost to see if the problem persist. And indeed it does.
I also though that it might be A DNS issue, so I checked the httpd.conf and windows DNS host files, I got 1 and only IP there, which is 127.0.0.1. I also updated the host in wordpress config.php to 127.0.0.1 as well as from the data base. Still, I get the same slowness for first time load. I argued that, if this is DNS issue then, its either the page would not load OR it loads but it should be consistently be the similar. However, the slowness is only affecting the first time load.
Server restarts, full shutdown+boot does not have an influence on page loads. Its only a matter of either its first time access by client or not.
I came through a post about nginx & php-fpm very slow on first access, where the user initially blamed his server, but It turned out, it was his CMS. And based from what I have experience, wordpress might be the cause of slow first time page load, However, I dont know which part in wordpress that I got to deal with to fix the issue, can somebody help me fix wordpress slow fist time load (on Local Server)?
WAMP (localhost), 32 xeon core 2.7Ghz, 24Gb RAM, SATAIII HDD, OpCache Enable though Zend Engine
No Plugin, v. 4.9
Chrome & Firefox Cache disabled in Developer Tools, cUrl