First pageload slow; browsing speedy thereafter
I have a bizarre problem whereby when I first browse to my c5 dev site, the first page load takes quite a while (up to 5-6 seconds), but thereafter things are nice and speedy (including on the initial page that I browsed to).
I've tried to improve matters by enabling Apache gzip in .htaccess, but that hasn't solved the problem of the first-page-load-delay.
It's annoying because obviously the first pageload is the first impression, so it's important that it is snappy. It doesn't happen every time, either. If after browsing for a bit, I close the browser (or open a different browser) and navigate back to the site, it's still snappy. It's like the server needs to 'wake up' the first time the site is accessed after a dormant period.
Here's the URL if anyone's interested:
btw I have the cache enabled and logging of exceptions disabled. The site is also in 'production' mode. I'm running 188.8.131.52.
Any help or ideas would be much appreciated :)
Can you explain re the Mime types?
<link rel="stylesheet" href="/something.css" />
it should be like
<link rel="stylesheet" type="text/css" href="/something.css" />
heres a complete list of mime types
What do you mean by in.php? i.e. homepage?
It's pretty irritating. I will try other hosting provider soon. It's some server side problem and I doubt that a change in HTML code or images size will help.
One notice: it waits a few seconds before it even sends some HTTP headers back to the browser. So it's not an issue with something after loading HTML part (CSS, JS, images).
I provide a firebug screenshot:http://web-tech.com.pl/performance.png...
That's strange. I've put out some timing info from dispatcher and database modules. And that's what I found:
/START/ select timestamp, cfValue from Config where cfKey = ? : 0.96540284156799 /END/ select timestamp, cfValue from Config where cfKey = 'ENABLE_LOG_ERRORS' : 0.96936392784119 /START/ select timestamp, cfValue from Config where cfKey = ? : 8.0839309692383 /END/ select timestamp, cfValue from Config where cfKey = 'URL_REWRITING' : 8.0861220359802
So it's 7 seconds between those 2 queries.
[startup config check:0.38580298423767]
So it's somewhere in app.php in config.
In code it happens here:
Performance problem pops into existence in one of those getOrDefine, but not during a SQL call (those are fast).
I thinkt it's very strange behavior.
I will need further investigation so I maybe will find out on which exact line it stops for such a long time and if it's always the same line.