Skip to main content

How to implement Caching in API or FrontEnd

Implementing caching efficiently on both the server and client side, can significantly improve the performance and responsiveness of the application. 


implement caching in .NET Core backend, and how to use it with your Angular frontend:

Set up Caching in .NET Core Backend

In .NET Core, we can use different types of caching, such as:

  • In-memory caching: Suitable for short-term data storage.
  • Distributed caching: Suitable for large-scale applications (e.g., using Redis or SQL Server).
Step 1: Add Caching Services to Startup.cs (.NET 6 and later - use program.cs - builder.Services.AddMemoryCache())



Comments

Popular posts from this blog

API Basics

 

Algorithm solving Common Patterns & Techniques

  These are targeted data manipulation strategies used to handle arrays, strings, and linked lists efficiently. Two Pointers : Uses two reference pointers to iterate through a data structure simultaneously, typically from opposite ends or at different speeds (Fast & Slow pointers). Sliding Window : Maintains a subset of data (a "window") over a sequential structure to track running statistics without recalculating the whole set. Prefix Sum : Pre-computes and stores cumulative sums of an array to allow for \(O(1)\) constant-time range sum queries. Dynamic Programming (DP ): Dynamic programming is an optimization technique used to solve problems by breaking them down into simpler subproblems and storing the results of these subproblems to avoid redundant computations. It is particularly effective for problems exhibiting overlapping subproblems and optimal substructure. Greedy Algorithm Breadth-First Search (BFS) / Depth-First Search (DFS) : Systematic graph and tree travers...