http common method properties | cacheable | API's

Опубликовано: 27 Декабрь 2024
на канале: Saravanan Seenivasan
230
8

HTTP - Common Method Properties
Each method implements a different semantics

1.Safe
2.Idempotent
3.Cacheable

Cacheable Methods - Request methods can be defined as cacheable to indicate that responses to them are allowed to be stored for future reuse

There are specific headers in the response, like Cache-Control, that prevent caching

However, a response to a POST request can also be cached if freshness is indicated and the Content-Location header is set

Methods like PUT or DELETE are not cacheable, and their result cannot be cached

cacheable methods: GET, HEAD (sometimes POST)
non-cacheable methods: POST, PUT, DELETE, CONNECT, OPTIONS, TRACE, PATCH