1. Cache Layer
- Memcache
- Distributed cache
- HTTP/CDN
- Browser
- Database buffer pool
2. Caching Patterns

- Cache-aside (usually used): miss first cache
- Read-through: only read from cache; cache update in DB
- Write-through: Write to cache and db synchronously.
- Write-back (usually used in tools): write to cache, background process flushes to DB
- Refresh-ahead: pre-warm cache before expired
3. TTL Strategy
- Countries, Categories:
- Product catalogue
- Minutes
- Changes occasionally
- User profile
- Minutes
- Invalidated on write
- Pricing
- Seconds to minutes
- Business-sensitive dynamic pricing
- Inventory count
- Seconds
- Frequently changes
- Cart
- Do not cache
- Make it correct