Python Web Apps that Fly with CDNs Transcripts
Chapter: Avoiding Stale Caches
Lecture: Welcome to fresh caches

Login or purchase this course to watch this video and the rest of the course contents.
0:00 At this point, you're probably pretty excited about all the possibilities that CDNs can
0:07 offer with their caching of our files, static small files, as well as our large ones throughout the globe.
0:14 And I've shown you a lot of the positives, but now it's time to address one of the drawbacks or potential negatives that this can lead to. Stale files.
0:26 How bad of a problem this is depends on what files it is and how much they have changed. So for example, maybe we've made a change to some image
0:38 and because the way the cache works, maybe a user's already seen that file, that image, and they come back and instead of seeing the new image,
0:46 they see the old one. That might sound bad, but it's actually the least of the problems you're gonna run into. A way bigger problem would be,
0:54 If we try to completely redesign the site and we change the CSS, and then we also change the HTML that requires that CSS to be changed,
1:05 but the CSS file stays cached, our website just won't look new, it'll look completely broken. So this is really important to understand and fix.
1:15 Now, what's awesome about this chapter is what I'm gonna show you here will basically automatically fix it,
1:22 keep it up to date and always, always in sync. There'll never ever be a stale cached file that you're gonna run into if you follow these techniques.
1:32 And this is applicable to standard web deployments, not just CDNs. So really easy to fix, but it's something you absolutely need to be aware of
1:44 because it's something you're gonna run into sooner or later.


Talk Python's Mastodon Michael Kennedy's Mastodon