From the course: Building and Securing RESTful APIs in ASP.NET Core

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

How HTTP caching works

How HTTP caching works - ASP.NET Core Tutorial

From the course: Building and Securing RESTful APIs in ASP.NET Core

Start my 1-month free trial

How HTTP caching works

- [Instructor] Caching is an important piece of any RESTful API. If resources and API responses are designed to be cached, clients won't need to make requests to the server again for the same resource while the cache is fresh. This reduces the load on your server and can increase both the response time of the API and the perceived response time in clients with cache responses. Caching involves both the client and the server. On the server side, your application can let clients know that responses are cacheable in a few ways. The first is by returning the cache control header with a response. The cache control header can specify the number of seconds a cache copy should be considered fresh or it can be used to disable caching entirely by setting the no-cache and no-store directives. The Expires header can also be used to let the client know how long to cache a request. If the date of the response is less than the timestamp in the header, the response is still fresh and it can be…

Contents