Basics Flashcards

Get a fucking job

1
Q

What is HTTP?

A

Hypertext Transfer Protocol. Protocol that defines how messages are formatted and transmitted between web browsers and servers. Human readable.

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

What is HTML?

A

Hypertext Markup Language. Standard language for creaing web pages. It uses tags to structure content.

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

How does a GET http message look like?

A

The GET message which specifies the GET method looks like this:

GET /path/to/resource HTTP/1.1
Host: 127.0.0.1:3000
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36

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

In which layer does HTTP works?

A

Application layer

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

What does it mean for HTTP to be stateless?

A

Means that the receiver must not retain a state from previous requests.

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

In which 3 locations can the cache be?

A

Browser cache, proxy server, reverse proxy server.

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

What is stale content?

A

Cached content that it’s expired.

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

What is cache validation?

A

Process of contacting the server to check the validity of cached content.

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

What is cache invalidation?

A

The process of removing any stale content in the cache.

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

How does content get cached?

A

Whenever a server sends a response message to the client, it sets some headers that are used by the client or any of the intermediate places to cache the content.

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

Why is the Cache-Control header preferred over others caching headers?

A

It was introduced with HTTP 1.1 and it is a multivalue header, which means it can return multiple directives of how the caching behavioir should be.

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

What does “Cache-Control: Private” mean?

A

It means that the content should only be cached in the client.

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

What does “Cache-Control: Public” mean?

A

It means that the content can be stored in proxies.

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

What does “Cache-Control: no-store” mean?

A

That the content should never be cached.

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

What does “Cache-Control: no-cache” mean?

A

The content can be cached but the client must validate the content using the ETag header.

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

What does “Cache-Control: max-age=3600” mean?

A

That the content is cached for a maximum of 3600 seconds.

17
Q

What does “Cache-Control: max-age=3600, must-revalidate” mean?

A

It means that after the max age has expired, the client must fetch the content from the server instead of the cache.

18
Q

What are the default ports for HTTP and HTTPS?

A

80 and 443

19
Q

What an ETag?

A

Entity Tag. When the server serves content, it usually marks it with an ETag. This ETag is used to check if cached content must be fetched again.

20
Q

What are the 6 things that an HTTP server do?

A
  1. Listens
  2. on a port
  3. for requests
  4. over the TCP
  5. returns a response
  6. and the resource requested.
21
Q
A