faqts : Computers : Programming : Languages : PHP : Installation and Setup : PHP4

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

22 of 23 people (96%) answered Yes
Recently 10 of 10 people (100%) answered Yes

Entry

PHP pages very fast in IE and extremely slow in Netscape! Any hints?

Jan 11th, 2001 03:42
Vincent E, Kelson Vibber, Boyan Mihaylov,


Generally speaking, the type of browser shouldn't affect server-side
processes beyond code specifically intended to act differently for
certain browsers.  It's possible, but it's more likely that the speed
difference is due to the resulting HTML code.
Are you using large or nested tables?  Images without width and height
attributes?  Have you validated your HTML with http://validator.w3.org/
or another validation service?  There are quite a few things in just
plain HTML that could cause a page to display faster in IE than in
Netscape 1-4.  (Netscape 6 and Mozilla fix most of these problems, but
it may take a while for your audience to upgrade.)
For instance, Netscape waits until everything in a table is loaded so it
knows how wide to make each cell.  IE displays the table contents as
they come in and resizes cells when necessary.  Breaking long tables
into smaller pieces can help.
Netscape also waits until it knows how large an image is before it will
display anything past it, while IE keeps displaying and just repositions
things once it determines the image size.  If you include width= and
height= values in the <img> tag, it doesn't need to start loading that
image to figure out how to position it, and it can start displaying text
further down the page.
IE also has a tendency to cache images and html data.
Even if you turn caching off, IE still caches and displays the data
without checking for new versions. That makes it very fast, but it can
also mean that sometimes pages don't get updated correctly.
Finally, every browser handles invalid HTML differently.  You may want
to check the resulting page for errors before comparing again (Opera 5
has this built-in, and there are a number of services that will let you
enter a URL to validate), or try comparing PHP-generated pages that are
long, but use simpler HTML.