Results 1 to 6 of 6

Thread: [RESOLVED] How is a web page processed?

  1. #1

    Thread Starter
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Resolved [RESOLVED] How is a web page processed?

    This one isn't so much web development, so I post here.

    In a web page, one may have something like this:

    <script language="JavaScript" src="/js/NNN.js" />

    At what stage in the execution of the page request is this file loaded? Logic would dictate that this JS file also be part of a request originating at the browser, and would constitute a separate GET request, aside from the GET being processed on the HTML page itself.

    Can someone confirm/correct this?

    The reason I am asking involves the creation of an HTTPHandler for IIS, the details of which I don't see necessary to get into at the moment. I can, if required.

  2. #2

    Thread Starter
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: How is a web page processed?

    PS: To get on my good side, you would confirm this behavior.

  3. #3
    Frenzied Member Inuyasha1782's Avatar
    Join Date
    May 2005
    Location
    California, USA
    Posts
    1,035

    Re: How is a web page processed?

    I would assume it created a second request because I'm preety sure the server never actually touches the insides of a file, it only returns it. So, when the request was first sent, the server would simply determine what type of file it is, make sure it's not something of a differrent language and needs to be parsed, check that the file is okay, and sends the contents back, not knowing that the actual file itself also needs another file. The only way for that to be possible would be that the server scans the file content first, for any requesting links like that, and returns the file, and any other requested file at the same time, but from my experience with packets I have never seen data recieved like that. Although I can't confirm that with documentation, it's preety self explanatory.
    Age - 15 ::: Level - Advanced
    If you find my post useful please ::Rate It::


  4. #4
    Addicted Member
    Join Date
    Jan 2001
    Location
    MPLS
    Posts
    187

    Re: How is a web page processed?

    I reviewed some of my web code that has this exact script/src tag. By viewing the web server log files you can clearly see it listed as a separate GET. However if multiple pages use the same script/src the entry does not always appear in the log file for a GET of the src code. This to me implies that the browser is doing the request on behalf of the script/src tag only when necessary since caching would come into play if its been requestd via another page already using it (script src). It seems to be treated the same as you would expect for images using img tags. One thing to note is that the the log time stamp is the same for the page and its contents that required GETs (script/src, img..).

  5. #5
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: How is a web page processed?

    Quote Originally Posted by mendhak
    At what stage in the execution of the page request is this file loaded?
    After the page is received and parsed, all external references are requested. If they are cached and the server returns "unchanged" the cached version is used, otherwise the request is continued.

    You can monitor the behaviour in Firefox, using the LiveHttpHeaders extension.

  6. #6

    Thread Starter
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: How is a web page processed?

    Quote Originally Posted by penagate
    After the page is received and parsed, all external references are requested. If they are cached and the server returns "unchanged" the cached version is used, otherwise the request is continued.

    You can monitor the behaviour in Firefox, using the LiveHttpHeaders extension.
    Thanks everyone, and this particular piece of information was helpful with something else I'm working on atm.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width