Caching in Django | TestDriven.io
testdriven.io · 2,903 words · saved by 1 readers
This article first provides an overview of Django's caching framework and then shows how to cache a Django view using both Memcached and Redis.
Caching is typically the most effective way to boost an application's performance. For dynamic websites, when rendering a template, you'll often have to gather data from various sources (like a database, the file system, and third-party APIs, to name a few), process the data, and apply business logic to it before serving it up to a client. Any delay due to network latency will be noticed by the end user. For instance, say you have to make an HTTP call to an external API to grab the data required to render a template. Even in perfect conditions this will increase the rendering time which…
related reading
- Using Flask and Redis to Optimize Web Application Performance | by Fahad Alsaedi | Mediummedium.com
- Getting Started: Caching | Next.jsnextjs.org
- Using Django | Django documentation | Djangodocs.djangoproject.com
- A very concrete explanation of how a cache worksparksb.github.io
- Set Up Django with Postgres, Nginx, and Gunicorn on Ubuntu | DigitalOceandigitalocean.com
- What is Memoization? How and When to Memoize in JavaScript and Reactfreecodecamp.org
- Deploying Django • Buttondownbuttondown.com
- KV Caching Explained: Optimizing Transformer Inference Efficiencyhuggingface.co
- Cache strategies · Hugging Facehuggingface.co
- Materialized views are obviously useful – Sophie Alpertsophiebits.com
- The simplest way to add server sent events to Django 🏺 - Tom Dekanphotondesigner.com
- HTTP caching - HTTP | MDNdeveloper.mozilla.org