Welcome to WebmasterWorld Guest from 18.104.22.168
The only difference between the two sites is that the one that displays normal is on LAMP system (Linux, Apache, MySQL, and PHP). The other one is on SAY5. Both servers are owned and operated by the same hosting company.
The hosting company claims that SAY5's increased PHP security comes at a cost--the unformatted page display. They seem to think that this is okay since it happens only on the first page visited. Subsequent pages viewed do not have the non-formatted page flash.
Is there a way to force PHP to build the entire page--with CSS formatting--before sending it to the browser?
Has anyone run into this before?
These are the web sites in question.
[edited by: eelixduppy at 5:20 pm (utc) on Feb. 17, 2009]
[edit reason] no personal URLs [/edit]
The idea that under SAY5 PHP apps run differently is absurd. Whatever setting they have enabled that is causing this problem can just as easily be disabled.
Or if they won't disable it then they should move you to a server without the issue. Telling you it's ok for your website to display with no CSS formatting on the visitor's first pageview makes my top 10 list of worst tech support responses of all time.
BTW I can't think of any security setting that would cause CSS not to display the first time. Most likely whoever told you this didn't know what they were talking about.
The ideal situation would be to get the hosting company to quit being lazy, but in the mean time, this might be of service.
"We looked into that. PHP runs in Fast-CGI mode in Say5, Although Say5 allows us to run it under 9 different configuration, but we decided this mode for maximum security. In this mode implicit_flush flag seems to be ON by default, We've set that to OFF in server wide configuration file to make it buffer the output before sending every line to visitors. Seems to be working much better."
Any suggestion(s) on how to respond?
With this change the flash is shorter in duration. However, it still exist and is unacceptable.
Tatorface, good call. Yes, it is seems to be only on the initial page the visitor comes in on. When the site's other pages are visited there doesn't appear to a flash of unformatted content--at least for me. For others the flash appears on other pages as well.
IanKelley, they did not explicitly say the unformatted content is okay. Their actual response is that it is the result of 'necessary' security settings.
[My apologies to eelixduppy for including links to a personal web site. Forgot that it wasn't permitted.]
[edited by: Storyman at 8:50 pm (utc) on Feb. 17, 2009]
If you want to stay with this host, take a look at ouput buffering, as tator suggested. What I would do is buffer the entire <head> section of your document with CSS included and then double flush that to the browser before proceeding with the <body> section.
This should hopefully cause the CSS formatting to get loaded before the page display starts.
If you're using external CSS you may have to compromise and make it on page... At least for the first pageview. Although if it were me I'd just find a better host.