3.3.8.API Caching (1 of 2) Concepts & Design decisions
Last updated
Last updated
Who cache
Caching can occur on any of point in the API path length.
Benefits
1.Improves performance
2.High Scalability/ Throughput
e.g., 客戶端需要60 calls/second, 但DB的極限只有50 calls/second, 因此可以在db前的端點做caching來解決這個問題
The closer the caching is done to the consumer the better will be the performance
What to cache/ How long to cache
3 factors when designing cache implementation
1.Speed of data change
2.Time sensitivity
3.Security
Design decisions
1.Which component should control the caching?
API server
2.What to cache? who can cache?
3.For how long is the cached data valid?
Depends on the nature of the data