N9. HTTP Flashcards

1
Q

What does HTTP stand for?

A

Hyper Text Transfer Protocol

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is HTTP?

A
  • protocol for www
  • client-server protocol
  • application level protocol (runs over TCP)
  • session: stateless (single req, single resp)
  • text-based (printable strings for headers and content of messages)

(focus on HTTP/1.1)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

In an HTTP response header, what would A and B refer to for content-type: A/B

A

A is the type of media e.g. text
B is the actual content type of the payload e.g. HTML

Type A/subtype B
e.g. text/html

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are the three common HTTP methods?

A

GET
- request specific page/object
- request has header only, no message body
HEAD
- request only header, not object itself
- can check timestamp against local cache
- request has header only, no message body
POST
- send form data to server
- request body contains form data

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are the HTTP response code types? Give some examples

A
Types:
1xx Informational
2xx Successful
3xx Redirection 
4xx Client error
5xx Server error
Examples:
200 OK
301 Moved permanently 
404 Not found
502 Bad Gateway
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What does it mean for HTTP to be stateless?

A
  • client requests treated independently
  • server does not maintain state/history of previous client requests
    (notion of application-level session must be built into the app. using HTTP)
  • client must fetch all page contents by sending separate GET requests for components of the page
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the main difference between HTTP 1.0 and HTTP 1.1 when fetching a page.

A

(A TCP connection must first be established)
HTTP 1.0 - closes TCP connection and creates a new one for every object linked on page
[Connection: close]
HTTP 1.1 - TCP connection kept open to fetch multiple objects
(reduced overhead)
[Connection: keep-alive]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Properties of HTTP/2

A
  • normal HTTP sitting over TLS
  • multiplexing: one TCP connection for multiple requests
  • piping: client can send requests in parallel and they are dealt with on one connection
  • uses binary encoding for compression instead of text-based protocol
  • server PUSH: server pre-emptively sends objects to client (caching)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Properties of HTTP/3

A
  • still being developed
  • will run over QUIC (UDP) not TCP
  • built-in security
  • faster connection set-up
  • features of HTTP/2
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is the cache?

A
  • performance optimisation tool
  • localised copy of data
  • means data is ‘closer’ to where it needs to be (spatial locality)
  • copied to cache ahead of time (temporal locality)
  • if original version of data changes, cached data will not (stale) because it is a copy
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is a proxy?

A

Something (system or router) that takes the place of the client to communicate with the server

  • for caching, the proxy can have a shared cache, allowing multiple clients to access cached resources from one place
  • could be used for security/privacy to monitor what all clients accessing a site are viewing
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

For caching, state some example header fields from requester and responder

A
Requester
- max-age 
- min-fresh
- max-stale
Responder
- must-revalidate 
- no-cache
- no-store
etc.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly