Chapter 1 Chapter 2 Chapter 3 Chapter 4 Chapter 5 Chapter 6 Chapter 7 Chapter 8 Chapter 9 Chapter 10 Chapter 11 Chapter 12 Chapter 13 Chapter 14
Chapter 8

HTTP Request Types & Caching

GET vs POST, and how browsers cache responses.


HTTP Request Types

Also known as request methods. The most popular are get and post, used to retrieve and send client form data to a web server.

GET requestPOST request
Sends form content as part of the URL
Retrieves the appropriate resource from the web server
Limits the query to 1024 characters
Updates the contents of the web server (e.g. posting new messages to a forum)
Has no limit on query length
Not part of the URL and cannot be seen by the user

POST data is sent to a server-side form handler.

Caching

  • Browsers cache (save on disk) web pages, allowing for quick reloading.
  • They cache responses to GET requests.
  • They do not cache responses to POST requests.