Caching महंगे operations (DB queries, computations, external API calls) के परिणामों को store करता है ताकि repeated requests को काम को फिर से किए बिना तेजी से serve किया जा सके। यह एक API के लिए highest-impact performance optimizations में से एक है।
In-memory caching (fastest, single-instance)
cache = ();
() {
(cache.(id)) cache.(id);
user = db.(id);
cache.(id, user);
user;
}
