Jump to content

Slow loading? Not sure where to post this.. =S


Recommended Posts

Can somebody please tell me why this is so slow? It's just a little PHP generated css file being included, but Firefox keeps taking 5 seconds to open it, even though it is on my computer already, is only 1KB, and is generated in like a millisecond.

I'm guessing it has something to do with the headers, so I will list them below;

 

Response Headers

Last-Modified Fri, 29 Jun 2007 06:21:39 GMT

Content-Type text/css;charset=iso-8859-1

Cache-Control accept

Content-Length 1168

Etag db3e14ec6d3295638b47df6979a9496660b7fe5f

Date Fri, 29 Jun 2007 06:22:00 GMT

Status 304 Not Modified

 

Request Headers

Host tso.hopto.org

User-Agent Mozilla/5.0 (Windows; U; Windows NT 5.2 x64; en-US; rv:1.8.0.7) Gecko/20060917 Firefox/1.5.0.7 (mmoy CE K8M-X19)

Accept text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5

Accept-Language en-us,en;q=0.8,ko-kp;q=0.7,ko-kr;q=0.5,ko;q=0.3,ja;q=0.2

Accept-Encoding gzip,deflate

Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7

Keep-Alive 300

Connection keep-alive

If-Modified-Since Fri, 29 Jun 2007 06:21:39 GMT

If-None-Match db3e14ec6d3295638b47df6979a9496660b7fe5f

Cache-Control max-age=0

 

I had something like this happen before when I was sending a Content-Length header that was bigger then the file actually was, and this hanged Firefox because it was waiting for the rest of the file to be sent.

 

But it is correct now, and is returning 304, so shouldn't it be instant? Why is adding 5 seconds to the load time of every page that includes it? =S

 

And this is only happening in Firefox, not Opera or Internet Explorer.

 

But if I don't include this little css file, the pages all open instantly, so it's not a problem with Firefox being slow.

 

Here is a demo where you can see the slowness in action (if you are using Firefox)

http://tso.hopto.org/example

 

Please tell me how I can fix it..

There could be a few things.

 

1. Accept-Encoding  gzip,deflate

2. Go to: http://www.websiteoptimization.com/services/analyze/ and test the above page

3. you have javascript stuff happening.

 

If its a php issue (as you think), then you need to put a time function/test in that php page.

 

-steve

I'm not sure how to set Firefox to not tell the server that it accepts gzip and deflate, and it does that in all HTTP requests so I'm pretty sure it's not that.

 

On the website you linked, it says

# Congratulations. This site is using HTTP compression, otherwise called content encoding using gzip. The sizes reported here are for compressed content sent from the server to the client.

 

* CSS alternate stylesheets may be referenced in the HTML but are not actually downloaded until they are needed and are therefore not included in the total page size.

Analysis and Recommendations

 

    * TOTAL_HTML - Congratulations, the total number of HTML files on this page (including the main HTML file) is 1 which most browsers can multithread. Minimizing HTTP requests is key for web site optimization.

    * TOTAL_OBJECTS - Congratulations, the total objects on this page (including the HTML) is 4 which most browsers can multithread. Minimizing HTTP requests is key for web site optimization.

    * TOTAL_IMAGES - Congratulations, the total number of images on this page is 1 . Most browsers can send multiple requests, which can speed display of multiple images.

    * TOTAL_CSS - Congratulations, the total number of external CSS files on this page is 1 . Because external CSS files must be in the HEAD of your HTML document, they must load first before any BODY content displays. Although they are cached, CSS files slow down the initial display of your page.

    * TOTAL_SIZE - Congratulations, the total size of this page is 10774 bytes. This page should load in less than eight seconds on a 56Kbps connection - or 2.95 seconds. But there's always room for improvement.

    * TOTAL_SCRIPT - Congratulations, the total number of external script files on this page is 1 . External scripts are less reliably cached than CSS files so consider combining scripts into one, or even embedding them into high-traffic pages.

    * HTML_SIZE - Congratulations, the total size of this HTML file is 392 bytes, which less than 20K. Assuming that you specify the HEIGHT and WIDTH of your images, this size allows your page to display content in well under 8 seconds, the average time users are willing to wait for a page to display without feedback.

    * IMAGES_SIZE - Congratulations, the total size of all your images is 6935 bytes, which is less than 15K. Ideally each image should be less than 1160 bytes, to easily fit into one TCP-IP packet.

    * SCRIPT_SIZE - Congratulations, the total size of all your external scripts is 2272 bytes, which is less than 4080 bytes. This will fit into three higher-speed TCP-IP packets.

    * CSS_SIZE - Congratulations, the total size of your external CSS is 1175 bytes, which is less than 4080 bytes. This will fit into three higher-speed TCP-IP packets.

    * MULTIM_SIZE - Congratulations, the total size of all your external multimedia files is 0 bytes, which is less than 4K.

 

I have tried removing the javascript, but it did not effect the load time.

 

I have timers in PHP for measuring how long it takes to generate a page, and it says it's only taking around 0.01983 seconds to generate the page.

 

 

I'm very very confused as to why it is so slow in Firefox but running fine in other browsers... but other sites I visit run fast in Firefox..

 

Could you please try opening it in Firefox and a different browser and see if it happens to you also, or if it's just me? :s

Update:

 

It seems to be happening whenever there is another download on a page from my site (like external JS or external CSS or image).

 

If I embed them into the source instead, it works.

 

If I put them on a seperate URL, it works.

 

I don't understand why this is or why it is only in Firefox.. (and also netscape I found out).

 

I like having them external so that it is faster, but I will have them in source for now until somebody can tell me how to fix it for Firefox.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.