Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Page Load - White "flash" inbetween pages

There are two websites, one live one under development. I am porting a site to Zend Framework (for maintainability/integration purposes).

The original (live) site has seamless page loads - it will load, then update the content on the screen while keeping the background image, navigation etc on the page.

The ported site (development) "flashes" completely white for a brief moment then all of the content appears simultaneously.

From what I understand, this is not a FOUC (flash of unstyled content). The content on both of the sites always appears fully styles with all CSS rules. The two sites look identical when rendered, they use the same images, css, and HTML markup. The only difference is one (development) is being served by Zend Framework and the other (live) by procedural PHP.

What are the main causes for this, and is this a known bug/configuration issue with ZF? I've had this problem before without using ZF and did not resolve it.

Thanks for your help.

like image 635
Mahdi.Montgomery Avatar asked Sep 15 '10 23:09

Mahdi.Montgomery


2 Answers

Try putting javascript at the bottom of the page, just before the closing body tag. This should speed up page rendering as loading javascript blocks other downloads (css, images, etc.) therefore leaving your page blank until all of your scripts have loaded.

like image 177
baseten Avatar answered Sep 28 '22 01:09

baseten


It could be your web server. Try comparing the HTTP headers of your servers with a web sniffer like http://web-sniffer.net/ and see if there's any difference in caching headers. If there is, then your browser is dumping everything and starting fresh, which could look almost like a FOUC in some circumstances.

like image 27
mattbasta Avatar answered Sep 28 '22 01:09

mattbasta