Skip to main content

Cache

Temporary data store, typically in RAM, that holds frequently accessed data for faster retrieval.

Core Conceptsโ€‹

  • Cache Operations
    • Cache Lookup: Application checks the cache for requested data
    • Cache Hit: Data is found in the cache and returned directly
    • Cache Miss: Data is not found in the cache. The application fetches it from the primary source, updates the cache, and returns the data

Benefitsโ€‹

  • Reduced database load
  • Faster data access (commonly retrieval from RAM)
  • Scalability
  • Cost-Effectiveness

Securityโ€‹

Cache Miss Attack exploits weaknesses in how data is stored to steal information or overload systems. It targets situations where a web application doesn't consider all input data when storing data in a cache. This lets attackers trick the cache into revealing sensitive information or causing performance issues.

Solutions:

  • Cache keys with null value. Set a short TTL (Time to Live) for keys with null value
  • Bloom filter to quickly check if key exists before hitting cache/database