Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7961831
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T05:09:39+00:00 2026-06-04T05:09:39+00:00

Goal I want to simulate with a request to a HTML-document just the way

  • 0

Goal

I want to simulate with a request to a HTML-document just the way a browser does. This means I not only want to download the main HTML file but also linked stuff like CSS, JS, images.

For now I only want to parse the first HTML document. I.e. I am not taking requests into account which result from parsing say the CSS (background-images, web-fonts) or JavaScript (Ajax) etc.

To implement this I need to know how a browser exactly processes a website. I haven’t found a good reference on that. Any help on that would be greatly appreciated and likely solve my problem.

Assumption

As I lacked any good references I assumed the process (without taking redirects, the rendering etc. into account) works like that:

  1. A persistent HTTP-connection is established with www.facebook.com
  2. The Path “/” is requested and the HTML is received
  3. When the the document is fully (?) received it is parsed and a list of URLs that need to be requested is filled (divided into head and body objects?!)
  4. The first URL is taken from the head-list and it is checked whether a persistent HTTP-connection is established with that host
    • If there is not, it is established and the afterwards the Object is requested
    • If there is, it is added to the connection’s “download queue”
  5. Step 4 is repeated until the list is empty
  6. Then Steps 4-5 are repeated for the “body list”

Is this even close to how a browser works?

Bonus question: Does the order of JavaScript and CSS files in the header make a difference?

Doubts

I conducted a few tests with the Chrome Developer Tools (Chrome 18) to confirm. I connected to www.facebook.com measuring when each Object was loaded. When reloading using Ctrl + R the results looked like this:

Output in the Chrome-Developer-Network-Tab for a request to www.facebook.com

What puzzles me the most is that most requests are concurrent to others even when from the same host (static.ak.fbcdn.net). Pipelining is disabled my browser (which is the default setting) so why are the request still seem to happen simultaneously?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T05:09:41+00:00Added an answer on June 4, 2026 at 5:09 am

    Browsers do use multiple connections, in order to speed up the downloading (parallel downloading of resources). They limit however the number of connections to the same host, which is one of the reasons for the existence of content-delivery networks.

    The order of CSS and Script files in the header do matter, as scripts block parallel downloading (unless the script is not defered).

    Also browsers parse HTML while they receive it (again to speed up things) – this is a reason if you put a script in the head that tries to manipulate DOM elements not yet loaded, you’ll get an error.

    But all of this are browser implementation details that may not be important for your task.
    Best – look at the source code of some headless browser to find what’s going on.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am not sure how to do this. The goal: I want to check
goal: I have the string 1234432144 I want to only replace the first 2
Goal : I want to allow the user to search for a document by
The Goal I want to select <td> elements that contain only a checkbox. I
goal : I want to place a text after the submit button using hook_form_alter.
My Goal: i want to create an horizontal list of images. when mouse is
I've recently started my new private project. The main goal which I want to
I want to extract kernel symbols from a u-boot image The final goal is
I have the pages that I want to set as a goal in Google
My goal here is to make a button. I want the text to sit

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.