Python Web Apps that Fly with CDNs Course

Python Web Apps that Fly with CDNs Course

English | MP4 | AVC 2560×1440 | AAC 44KHz 2ch | 58 Lessons (3h 5m) | 759 MB

You’re ready to launch your Python app. You want it to FLY of course. Static resources can be a huge portion of that equation. Leveraging a CDN could save you over 75% of your server load and make it way faster. This course with show you how in a step by step guide. It’s way easier than you think.

It’s not just server-side Python performance that matters
Building a high performance Python web app requires many key elements. First you likely focus on your Python code and making the database fast. But on my web page requests, that Python HTML response is a small, although important, portion. It’s common to have 30, 40, 50, or more requests per page. In production, the frequent guidance is to host these behind nginx or similar server. Often that is enough. But by bringing a CDN into the mix to globally replicate and localize all those requests can seriously improve the perceived speed of your app for a global user-base. But did you know that these static resources can put a massive load on your server too? This course will give you a step by step guide with live code demos on how to incorporate a CDN (Bunny CND specifically) with a Flask application. You will also see the before and after performance stats from Talk Python’s web infrastructure from last year’s Black Friday week of traffic.

What will you learn?
In this course, you will:

  • See how CDNs work and interplay with your web application
  • Leverage the CDN to deliver globally-scaled, geo-replicated content
  • Use the CDN for your static content (images, css, javascript, etc.)
  • Avoid stale cache content while 100% caching static content on the CDN and clients
  • Host large, user-generated content (audio, video, documents, etc.)
  • Use storage zones to serve large content globally
  • Debug issues with CDN content at the CDN level, web app level, and browser level
  • Test user-percieved performance for your web app (full page loads, not just Python paths)
  • Replace Google fonts with GDPR / privacy friendly alternatives
Table of Contents

1 Welcome
2 What is a CDN?
3 More than one request
4 Not just optimizing server-side
5 Why I avoided a CDN
6 Tech stack for our app
7 What are we going to build?
8 Meet your instructor
9 Setup intro
10 Get the source
11 Installing Python 3
12 Editor choices
13 Bunny.net account
14 Intro to static content
15 Running the demo app
16 Project code structure
17 Local is always fast
18 Running over ngrok
19 CDNs and pull zones
20 Creating the static content pull zone
21 First CDN url
22 The rest of the static links
23 Faster still with preconnect tag
24 Smaller images are still better
25 Be careful with private content
26 Large content introduction
27 CDN object storage
28 How Talk Python uses storage
29 Where is our large content in the app?
30 Getting the large files
31 Creating the storage zone
32 Uploading files
33 Connecting and testing the CDN
34 Demo: User-generated content in app
35 Welcome to fresh caches
36 The caching problem
37 The caching fix
38 cache_id_builder
39 Demo: using cache_id_builder
40 Remember vary by in the CDN
41 Finishing the rest of the links
42 Troubleshooting introduction
43 Check the dev tools
44 Try without the CDN
45 Demo: Toggling CDN on and off for dev
46 The CDN keeps logs too
47 Purge the cache
48 Fonts are tricky on the web
49 But it’s an ad company
50 Bunny is not an ad company
51 What does API compatible mean?
52 Using Bunny fonts
53 Performance testing introduction
54 Testing with LightHouse
55 Testing with network tools
56 Quick review and thanks
57 Remember the repo
58 Stay in touch

Homepage