|
home—lects—hws
D2L—breeze (snow day)
youtube: inside http headers (19m55s)
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: stringurl → stringhtml
browser: stringhtml → void .
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 .
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.
home—lects—hws
D2L—breeze (snow day)
©2017, Ian Barland, Radford University Last modified 2017.Aug.28 (Mon) |
Please mail any suggestions (incl. typos, broken links) to ibarlandradford.edu |