# I want to cache it. Now

- Speaker: [Dimitri Krassovski](/wiki/speakers/dimitri-krassovski.md), [Eugene Olshenbaum](/wiki/speakers/eugene-olshenbaum.md)
- Event: [Reversim Summit 2013](/wiki/years/2013.md)
- Video: https://www.youtube.com/watch?v=b-Lt5SI72cM
- Transcript: [/transcripts/2013/02-b-Lt5SI72cM.md](/transcripts/2013/02-b-Lt5SI72cM.md)
- Language: Hebrew and English · Type: talk · Level: intermediate
- Topics: [Scalability](/wiki/topics/scalability.md), [Networking](/wiki/topics/networking.md), [DevOps](/wiki/topics/devops.md), [Performance](/wiki/topics/performance.md)

> Written by an LLM from machine transcripts. It can contain errors. Check the transcript before you quote it.

## Summary

This talk explores the challenges and best practices of caching in modern web applications. The speakers argue that relying on database caches or quick-fix strategies like cache-killers often masks architectural flaws rather than solving them. Instead, the audience learns to leverage browser caching, utilize content delivery networks effectively, and implement immutable assets with versioning in the file path.

## Key points

- [3:10](https://www.youtube.com/watch?v=b-Lt5SI72cM&t=190s) Placing a cache module between the database and application server is often a symptom of architectural issues.
- [5:11](https://www.youtube.com/watch?v=b-Lt5SI72cM&t=311s) Modern web applications should focus on browser caching rather than overusing server-side caching layers.
- [11:48](https://www.youtube.com/watch?v=b-Lt5SI72cM&t=708s) HTTP headers such as max-age and cache-control directives like private versus public must be carefully configured.
- [17:08](https://www.youtube.com/watch?v=b-Lt5SI72cM&t=1028s) Treating all static assets and resources as immutable significantly improves application reliability and caching behavior.
- [22:28](https://www.youtube.com/watch?v=b-Lt5SI72cM&t=1348s) Using query-string cache-killers can lead to race conditions, proxy misbehavior, and cache poisoning.
- [34:16](https://www.youtube.com/watch?v=b-Lt5SI72cM&t=2056s) Versioning static files directly in the URL path is a robust solution to synchronization issues during deployments.

## Takeaways

- Rely on proper database design and primary key lookups instead of adding unnecessary cache layers.
- Mark static assets as immutable and serve them with long expiration times.
- Avoid query-string cache-busters and use versioning in the file path for reliable deployments.
- Properly configure CDN and HTTP caching headers to prevent cache poisoning.

## Questions this talk answers

- Where is the best place to implement caching in a modern web application stack?
- Why are query-string cache-killers considered a bad practice?
- How should static asset versioning be handled during continuous deployments?

## Technologies

MySQL, Node.js, Nginx, Akamai, CloudFront

## Tags

caching, cdn, frontend deployment, http headers, performance optimization, web architecture
