- Traditionally, why has it been better to serve site assets from multiple domains?
It’s easy to let other common public stable CDN to host the non-critical resources like JS libraries, images, CSS.
CDNs are much more powerful and faster to deliver the content if you site users are from different countries. Secondly, browsers usually limit the requests of downloading files from a single host. Using multiple domains to deliver the content can help avoid this fallback and hence improve site loading speed.
- Do your best to describe the process from the time you type in a website’s URL to it finishing loading on your screen.
A great blog post to describe this: What real happens when you navigate to a URL?
DNS lookup > browser cache check > HTTP request to web server > maybe redirects > HTML response > HTML rendering > HTML content fetching
- What are the differences between Long-Polling, Websockets and Server-Sent Events?
Polling, Long Polling, Comet, Server-sent Events (SSE), and WebSockets.
- Explain the following request and response headers:
- Diff. between Expires, Date, Age and If-Modified
- Do Not Track
For introduction of HTTP headers.
- What are HTTP methods? List all HTTP methods that you know, and explain them.
GET: get resource. Data or query parameters are sent in the URL. Size is limited by browser.
POST: get resource. Query parameters are sent in the HTTP request body. No size limitation.
HEAD: same as GET but returns only HTTP headers and no document body. It can be used to detect server service updates.
PUT: Uploads a representation of the specified URI.
DELETE: Deletes the specified resource.
OPTIONS: Returns the HTTP methods that the server supports.
- HTTP Status Codes
- 200’s are used for successful requests.
- 300’s are for redirections.
- 400’s are used if there was a problem with the request.
- 500’s are used if there was a problem with the server.