Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/topics/caching/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Baqend uses a combination of CDN and client caching using a Bloom filter-based d

### Caching everything, not just assets

The tricky thing when using such caches is that you must specify a cache lifetime (TTL) when you first deliver the data from the server. After that you do not have any chance to kick the data out. It will be served by the browser cache up to the moment the TTL expires. For static assets it is not such a complex thing, since they usually only change when you deploy a new version of your web application. Therefore, you can use cool tools like [gulp-rev-all](https://github.com/smysnk/gulp-rev-all) and[grunt-filerev](https://github.com/yeoman/grunt-filerev) to hash the assets. By renaming the assets at deployment time you ensure that all users will see the latest version of your page while using caches at their best
The tricky thing when using such caches is that you must specify a cache lifetime (TTL) when you first deliver the data from the server. After that you do not have any chance to kick the data out. It will be served by the browser cache up to the moment the TTL expires. For static assets it is not such a complex thing, since they usually only change when you deploy a new version of your web application. Therefore, you can use cool tools like [gulp-rev-all](https://github.com/smysnk/gulp-rev-all) and [grunt-filerev](https://github.com/yeoman/grunt-filerev) to hash the assets. By renaming the assets at deployment time you ensure that all users will see the latest version of your page while using caches at their best

But wait! What do you do with all the data which is loaded and changed by your application at runtime? Changing user profiles, updating a post or adding a new comment are seemingly impossible to combine with the browsers cache, since you cannot estimate when such updates will happen in the future. Therefore, caching is just disabled or very low TTLs are used.

Expand Down