DjangoCon Europe 2023

Caching everywhere
2023-05-30 , Music Hall

How to cache things everywhere. From basic Django cache framework to function memoizing, custom application caching, django-cacheback, webserver caching, CDN, geolocation tricks.


Video: https://youtu.be/P6WvCo2JNjI

Caching is a broad subject and it is difficult to understand what, where and when to cache something. It involves tricks with cookies, HTTP headers, CDN specifics.

It is an opinionated overview about all these options and how they helped my projects to scale.

  • Django cache framework basics
  • Basic memoization
  • How to lazy cache with django-cacheback
  • How to use "stale while update" and other types of otimizations
  • How to hack around your webserver (like nginx) to improve your cache hits
  • How to use CDN and optimize with surrogate headers
  • How to cache based on geolocation or other user parameters
  • How to architect pages for caching

Computer Engineer working and scaling Python and Django more than I should, for 12 years already.