Home » Cache

Cache

Clients are able to cache responses. Servers must mark responses as cacheable or non-cacheable. Responses are implicitly or explicitly labeled as cacheable or non-cacheable. Caching is done on the client side. While you may be able to cache some data within your architecture to perform overall performance, the intent is to instruct the client on how it should proceed and whether or not the client can store the data temporarily. Cache is an optional constraint.

Protocols, like SOAP, that only use HTTP as a convenient way to get through firewalls (by using POST for all requests) miss out on the improved performance from HTTP caching, which reduces their performance

Important properties:

  efficiency: client is given the right to reuse chached response data for later, equivalent requests;
  scalability: there are also gateway caches, CDN, reverse proxy caches and load balancers that are deployed on web servers for better reliability, performance and scaling of web sites and web applications;
  performance: cache can reduce the number of client-server interactions, which contributes positively to the performance of the system at least, as perceived from the user’s point of view;

Important trade-off:

  reliability: degrades reliability;


Cache Cache concept
Fielding’s thesis part https://www.ics.uci.edu/~fielding/pubs/dissertation/rest_arch_style.htm#fig_5_5
Nordic APIs https://nordicapis.com/general-techniques-for-proper-api-caching/
REST better: HTTP cache https://odino.org/rest-better-http-cache/
Ronnie Mitra blogs https://www.freshblurbs.com/blog/2015/12/12/http-cache-restful-apis.html
Posnik & Grigorik https://web.dev/http-cache/ (Prevent unnecessary network requests with the HTTP Cache)
MDN Webdocs Mozilla https://developer.mozilla.org/en-US/docs/Web/HTTP/Caching (Different kind of caches)
Kevin Sookocheff https://sookocheff.com/post/api/effective-caching/ (Effective Cache Control)