|
Recall: In essence, a web-server and web-browser are each functions with the type-signatures:The above is a lie. Let's look more closely.
server : string → string (or, if you have very specific classes,Url → HtmlStr )
browser : string → void (orHtmlDoc → void ).
video: inside http headers (19m54s)
As the video is playing, follow along and be looking at the developer-tools yourself.
Errata: Places where I misspoke, in the video:
06:48 The “Host:” field is just the sever's name (separate from the rest of the URL)
09:38 A better example where knowing user-agent is helpful to server: software-download pages can know what version to suggest.
09:48 “maybe thebrowserserver could give back a different response, based on which browser I'm using”
15:52 “on futureresponsesrequests”
For this class, you'll need a browser with good debug-tools built in. For Firefox, there is an extension “Firebug”; I'll demo a couple of Chrome's built-in tools. We will not worry about supporting old browers (e.g. old versions of IE).
≡ » More Tools » Developer Tools
We’ll look briefly at the Elements tab,
but today we're mostly concerned with the Network tab,
and clicking on particular files.
(You might need to click on View » Hide Overview.)
In particular, viewing the Request Headers and Response Headers.
Together in class: Spend 15min looking at examples.
Btw, here are the official HTTP response codes, or the cat-picture version.
the real upshot: So, the essence of the situation is actually that the server and browser are functions with the type-signatures:
server: http-request-packet → http-response-packet (where the first packet contains the URL, and the second packet contains the html response);
browser: http-response-packet → void (changing pixels on a screen, as side-effect).1
Further things to consider (if not today, then perhaps later:)
- ACTUAL: server-side computation (via Ajax): on each keystroke, a transaction is happening, and google.com computes the completion (for *every* google visitor in the world, yikes, is that a lot of bandwidth?) - What are some other *hypothetical* was this could be handled? - client-side: the server includes the top 10,000 most popular searches, and the client javascript uses that to determine the auto-completion. (This wouldn't explain the .) That would be an expensive load-time on every page! How might we use this approach but try to avoid having 'google.com' be a huge download every time? How about: only include that dictionary on the *first* visit to google.com, and have the client javascript write it to a file; then on subsequent visits this This requires something additional though: How does google know if this is the *first* time I'm visiting, or if I've visited previously and therefore I already have the set of common-searches cached? We'll discuss cookies later, which solve this.
This page licensed CC-BY 4.0 Ian Barland Page last generated 2018.Aug.14 (Tue) | Please mail any suggestions (incl. typos, broken links) to ibarlandradford.edu |