Post Reply 
How to request http servers to send the image first ?
Sep. 08, 2005, 12:37 PM
Post: #1
How to request http servers to send the image first ?
Hi !

The images from various websites are fetched slowly and after fetching the text contents. Is there a way to send a header request through proxo to the various webservers to transmit the images before the text contents? ( I am a novice and may be I am not sure about the way http protocols work)

Thanks
Garcot
Add Thank You Quote this message in a reply
Sep. 08, 2005, 07:34 PM
Post: #2
 
I think that's just the way browsers interpret the HTML code. First they download all the HTML code and display it. Naturally, the text is displayed first because it's all there with the already downloaded code. The images have to be downloaded then too, so they come after.

�{=(~�::[Shea]::��~)=}�
How 'bout you sideburns, you want some of this milk?
This fading text is pretty cool, eh? I bet you wish you had some.
Add Thank You Quote this message in a reply
Sep. 08, 2005, 11:27 PM
Post: #3
 
garcot;

Shea has it pretty much 100% correct. In point of fact, even if the HTML code is set to ask for all the images first (and it's done more often that you may think, by using javascript), it still takes a finite amount of time to:

a) see the request amongst the code,
b) send the request back out to the server,
c) get the image from the server, and
d) render it for display.

The image is being dowloaded in a different connection, not the same one as where the HTML code, scripts, text, image requests and so forth is coming in. I'd hazard to guess that by the time the first image request has been processed, all the rest of the stuff has arrived, and is probably ready to go. Hence, there's really no good reason for the browser to wait until all of the images have arrived, it might as well go ahead and display the text.

Of course, this is probably the greatest single cause of seeing your screen go berserk, re-arranging stuff several times until you get seasick. In simple terms, the browser is inserting newly d/l'ed images into the previously rendered text. (And I can almost guarantee that in those cases, the programmer didn't specify the width and heigth properties in the <img .... tag, he just left it open. Naughty programmer, naughty naughty. Geek )

But just to be perverse, Pervert ask sidki3003 to hack you up a filter with a SetTimeout that prevents rendering anything on the screen until every element has been d/l'ed and is ready for presentation. Sell tickets to the rubes who want to see the reaction on his face, it'll be priceless! Rocker


Oddysey

I'm no longer in the rat race - the rats won't have me!
Add Thank You Quote this message in a reply
Sep. 09, 2005, 04:20 AM
Post: #4
 
Thanks Shea and Oddysey! for all the info.

May be I will wait for Sidki3003 to help me out with a filter.

Garcot
Add Thank You Quote this message in a reply
Sep. 09, 2005, 11:24 AM
Post: #5
 
The easiest way is to switch to Firefox -> fire up "about:config" -> right-click in window -> New -> Integer -> enter "nglayout.initialpaint.delay" (w/o quotes) -> give it a high value, e.g. 1000 (default is 250, unit is ms).

sidki
Add Thank You Quote this message in a reply
Sep. 09, 2005, 11:59 AM
Post: #6
 
Hi Sidki3003,

Thanks for your reply. But I would be happy, if you can suggest small filter to request a http server to give higher priority for triggering the transmission of images from their image servers.

I still find IE6 to be faster than Firefox. I have tweaked Firefox config file well enough, but found some limitation in Firefox which slows down page rendering and fetching.

Regards
Garcot
Quote this message in a reply
Sep. 11, 2005, 09:38 AM
Post: #7
 
You can't do it with a "small" header filter, because it's not a header issue, for reasons that Shea and Oddysey have explained.

So here is a filter that delays page display until all elements have loaded. Since IE doesn't always succeed in loading all images, the page will be displayed after 10 seconds anyway.
Code:
[Patterns]
Name = "Delay Display till Page has loaded"
Active = TRUE
Multi = TRUE
URL = "$TYPE(htm)"
Limit = 256
Match = "<(body*>)\1$STOP()"
Replace = "<\1\r\n<script type="text/javascript">\r\n"
          "var prxBody = document.getElementsByTagName("body")[0].style;"
          "prxBody.visibility="hidden";"
          "window.setTimeout(function() {prxBody.visibility="visible";}, 10000);"
          ""
          "function PrxModOnload() {"
          "  prxBody.visibility="visible";"
          "  if (window.PrxOrigOnload) {"
          "    try {if (!typeof window.PrxOrigOnload() == "undefined") window.PrxOrigOnload()} catch(er) {};"
          "  };"
          "};"
          "if (window.onload) window.PrxOrigOnload = window.onload;"
          "window.onload = PrxModOnload;\r\n"
          "</script>\r\n"
This filter might be problematic on some pages. So, if you have further questions, i'm sure Oddysey will see his chance to move a bit from talking towards practical help. Wink

sidki
Add Thank You Quote this message in a reply
Sep. 11, 2005, 08:53 PM
Post: #8
 
sidki;
sidki3003 Wrote:..... So, if you have further questions, i'm sure Oddysey will see his chance to move a bit from talking towards practical help. Wink
Hey, I resemble that remark! Cry

Beside, it's not me who earned the moniker "The Filter Factory" - there's only one of them, and we all know who that is, right? Cheers

As it happens, I'm a programmer of the old school - I solve problems, and I always look for the simplest solution. Crazy That means that many of my 'brute force' filters are unfit for general consumption. I'm sure I've got more to learn than one may realize - I just sound like I know what I'm talking about. Suspicious

So here's the Official Breakdown between sidki and me:

Me = Simple = "it works - Miller time!"

sidki = Correct = "a filter a day keeps the malware away!"

Guess whose philosophy is gonna hold the higher ground over the long run?


Oddysey

I'm no longer in the rat race - the rats won't have me!
Add Thank You Quote this message in a reply
Sep. 12, 2005, 10:11 AM
Post: #9
 
a filter a day, that's my way...
Add Thank You Quote this message in a reply
Sep. 14, 2005, 03:44 AM
Post: #10
 
Thanks Sidki3003.

The page loading gets delayed according to the filter. However, some pages don't get loaded properly.

Thanks again
Garcot
Quote this message in a reply
Post Reply 


Forum Jump: