Tugas Networking Baru
Tugas Networking Baru
Other duties of a web server are to Execute server-side scripts to generate a portion of
or all the web page, Log information based on requests and the status of those
requests, Perform URL (Uniform Resource Locator) redirection, Authenticate user to
access restricted files, Process form data and information provided by a web client’s
cookies, enforce security, handle content negotiation, etc.
2. The option method will return the list of available methods for a given server.
3. The difference between POST and PUT is that PUT requests are idempotent. That is,
calling the same PUT request multiple times will always produce the same result. In
contrast, calling a POST request repeatedly have side effects of creating the same
resource multiple times. Besides that, GET method is different from both of them
because GET method is requests a copy of the given resource to be returned.
4. DELETE, PATCH, POST, and PUT
5. ETag is a unique identifier used to mark a specific resource for cache control, to be
used in conjunction with If-Match and If-None-Match
6. The If-Match header is used to make a request conditional on the ETag value of a
resource matching a specified value. The If-None-Match header is used to make a
request conditional on the ETag value of a resource not matching a specified value.
7. The Referer header in HTTP contains the address of the previous web page from
which a link to the currently requested page was followed. It allows a server to
identify the referring page that the user is visiting from or where the requested
resources are being used
8. It’s used to indicate that a request has been successful and has resulted in the creation
of a new resource on the server
9. Code 404 known as “Not Found” indicates that the server has not found anything
matching the request URL but we don’t know if it’s temporary or permanent. On the
other hand, Code 410 known as “Gone”, is a more specific status code than 404. It
indicates that the requested source is no longer available at the server and this
condition is usually permanent.
10. The range of HTTP status codes used for redirection events is 300 to 399. Some of the
common codes are 301(Move permanently), 302(Found), 303(See Other), and 308
(Permanent redirect).
11. The range of HTTP status codes used for errors is 500-599. Some of codes commonly
used are 500(Internal server error), 502(Bad Gateway), 503(Service Unavailable), and
504(Gateway timeout).
12. The Location header is used with HTTP status codes in the 3xx range, which are
redirection messages, and the HTTP status code 201, which indicates that a new
resource has been created.
13. A session cookie is used for temporary storage and will be deleted when the browser
is closed. While persistent cookies provide long-term storage and can be used to track
user behavior and maintain user preferences across multiple session.
14. A) E will be error
B) F and G will be error
C) D is dependant on A stream
D) No, it doesn’t not
15. 400 Bad Request: This error is generated when the server receives a malformed or
invalid request. It is similar to the HTTP/1.1 Bad Request error
16. In public-key encryption, a key is used to generate both a key and a certificate. The
process involves creating a key pair consisting of a public key and a private key. The
public key is used to encrypt data, while the private key is used to decrypt it. A
certificate is a digitally signed document that binds a public key to an entity, such as a
user or organization.
17. False, a company cannot sign its own certificate
18. False, To be secure, an encryption key should be much longer than 32 bits. In fact,
many observers consider 128 bits to be sufficient for the foreseeable future for
symmetric algorithms like AES, and asymmetric algorithms like RSA typically use
key lengths between 1,024 and 4,096 bits for security.
19. HPACK is a compression format specifically designed for HTTP header compression
in HTTP/2. It is a binary format that efficiently represents HTTP header fields, aiming
to reduce overhead and improve performance. HPACK uses a predefined static
dictionary, a dynamic dictionary, and Huffman encoding to achieve efficient header
representation.
20. False. Once a session starts in HTTP/2, it stays in HTTP/2 until it terminates. HTTP/2
is a binary protocol that is not backward compatible with HTTP/1.1, and a client
cannot switch from HTTP/2 to HTTP/1.1 during a session. However, a client can
initiate a new session using HTTP/1.1 after terminating an HTTP/2 session
21. In HTTP/2, the :scheme header specifies the request scheme, which is typically 'http'
or 'https'. It is one of the pseudo-headers used in HTTP/2 to convey information about
the request. The use of pseudo-headers distinguishes HTTP/2 from HTTP/1, where
the request scheme is not explicitly specified as a header.
22. True. Both Apache and IIS can support virtual hosts. In Apache, virtual hosts allow
the same server to host multiple domains or websites, while in IIS, a similar concept
is achieved using site bindings to host multiple websites on the same server with a
single IP address
23. The item returned to your web browser with the header Cache-Control: max-
age=1000, no-cache can be cached in a proxy server’s cache, but it cannot be cached
in your web browser’s cache.The max-age directive specifies that the response can be
cached by both the browser and the proxy server for up to 1000 seconds. This allows
the proxy server to cache the response for the specified duration. However, the no-
cache directive indicates that the browser must revalidate the response with the origin
server before using it, effectively preventing the browser from caching the response.
Therefore, the response can be cached in a proxy server’s cache, but it cannot be
cached in your web browser’s cache
24. The item returned to your web browser with the header Cache-Control: no-
store cannot be cached in a proxy server's cache. The no-store directive indicates that
the response is not to be stored in any cache, including the client's browser cache and
proxy server caches. Therefore, the response must be requested from the origin server
each time it is needed, and it cannot be stored in any cache along the way.
25. Deflate is a more commonly used and more efficient algorithm compared to
Compress. Deflate is widely used and is the underlying compression algorithm for
popular formats such as gzip and zlib. It provides a good balance between
compression ratio and speed, making it suitable for a variety of applications.
26. A 302 status code indicates a temporary redirect, while a 200 status code indicates a
successful request that returns the requested content.
27. The 301 status code is used for permanent redirects, while the 307 status code is used
for temporary redirects, and it preserves the original request method
28. The status code that is returned without another URL to use is 307 Temporary
Redirect.