Website freezes on load for a couple of seconds
I'm working on a Wordpress-powered website (hasn't gone live yet). Most of the time when I load the home page it's fine. Sometimes, however, it freezes for a second on load, bef开发者_StackOverflowore continuing as normal. How do I debug this issue?
First I would profile your php performance with:
- xdebug using external tools like cachegrind
Next I would also do some base tests with:
- Google Page Speed.
- Yahoo! YSlow
Are you testing it on a server or locally?
I've encountered this while developing on a local server, and it's the database access lag usually.
Chrome has a developer tool that lets you profile the page and see how much time the browser spends on different things. Its located under developer tools and is called timelines.
I think firebug for firefox can do the same but I have never used that.
Big external resources that require a reflow may block content. Look for complex javascripts and embedded fonts in addition to your general performance analysis.
精彩评论