Day-1 of learning Web-Development
#Backend Engineering Day-1
----------------------------------- 1st Topic ---> The Big Picture of Backend ------------------------
summarized in the picture below .
And we have the same backend shape everywhere
Doesn’t matter : Node,Java,Go,Python
All follow the same flow.
----------------------------------- 2nd Topic ---> The Transport Layer --------------------------------
Here just summarizing what i stuided today:
HTTP
A lang client and server use to communicate.
Everything starts with HTTP.
A client sends a request.
A server sends a response.
A request has a method, a URL, some headers, and sometimes a body.
A response has a status code, headers, and a body.
HTTP methods
GET is for reading data.
POST is for creating something new.
PUT replaces existing data.
PATCH updates part of it.
DELETE removes it.
OPTIONS is not an action. It’s a question. It asks what is allowed.
Status codes
Status codes are just outcomes.
2xx -->things worked.
3xx --> resource rediraction.
4xx --> the client messed up.
5xx --> the server failed.
Browser security and same-origin policy
Browsers add another rule called same-origin policy.
By default, JavaScript is not allowed to read responses from other domains.
This exists for safety.
CORS and controlled access
CORS exists to relax that rule, but only when the server agrees.
The browser asks.
The server answers.
The browser enforces.
If the server allows the origin, the browser lets JavaScript see the response.
If not, the response still arrives, but JavaScript is blocked from reading it.
Simple requests vs risky requests
Some requests are considered safe and simple, so they are sent directly.
Others are risky, like PUT, DELETE, JSON data, or custom headers.
For those, the browser sends an OPTIONS request first.
This is a permission check, not a real action.
Preflight caching
To avoid repeating this check every time, the server can say how long the permission is valid.
The browser caches that decision.
HTTP caching
Caching exists to avoid asking for the same data again and again.
This makes things faster and cheaper.
Content negotiation
Content negotiation lets one server serve many clients.
The client says what format or language it prefers.
The server responds with the best match.
Compression
Compression exists to send less data over the network.
The server compresses.
The client decompresses automatically.
Connections
Connections are usually kept open so multiple requests can reuse the same TCP connection.
This saves time.
Large data transfer
Large data is sent in pieces, not all at once.
The client and server rebuild it as it arrives.
HTTPS and security
It protects data from being read or modified in transit.
Same HTTP rules, just secured.
0
0 comments
Shoaib Khan
2
Day-1 of learning Web-Development
powered by
Make $1k-$10k in 30 days
skool.com/make-1k-5k-in-30-days-8449
Media Valley School is the fastest way to hit $1K/month with freelancing or agency work. Guaranteed.
Land your first $1K month in 30 days
Build your own community
Bring people together around your passion and get paid.
Powered by