Fork me on GitHub

Web Servers

Web servers respond to Hypertext Transfer Protocol (HTTP) requests from clients. A client is usually a browser such as Internet Explorer, Firefox, or Chrome, but it can also be a

  • headless browser, which is commonly use for testing, such as phantomjs
  • commandline utility like wget or curl
  • a text-based web browser such as Lynx
  • web crawler.

Web server process requests from the above clients. The result of the web server's processing is a response code and commonly a content response. Some status codes, such as 204 (No content) and 403 (Forbidden), do not have content responses.

In a simple case, the client will request a static asset such as a picture or JavaScript file. The file sits on the file system in a location the web server is authorized to access and the web server sends the file to the client with a 200 status code. If the client already requested the file and the file has not changed, the web server will pass back a 304 "Not modified" response indicating the client already has the latest version of that file.

Web server and web browser request-response cycles

A web server sends files to a web browser based on the web browser's request. In the first request, the browser accessed the "www.fullstackpython.com" address and the server responded with the index.html HTML-formatted file. That HTML file contained references to other files, such as style.css and script.js that the browser then requested from the server.

Sending static assets (such as CSS and JavaScript files) can eat up a large amount of bandwidth which is why using a Content Delivery Network (CDN) is important when possible (see the content delivery network section for a more detailed explanation).


Next read the platform-as-a-service section.