Grokking Django
Vote

0% completed

​

Caching Values and Template Fragments in Django

A view that needs 3 seconds to build a page needs 3 seconds for every visitor, even when nothing on the page has changed since the last visit. If Django keeps the finished result and hands it to the next visitor, the second request takes about 1 millisecond. That figure comes from a 3-second view of the blog whose whole response was cached. Keeping a result so that later requests can reuse it is called caching, and the place where Django keeps those results is the cache.

Caching has a cost. A cached result can be out of date, and every cache needs a rule for when to throw an entry away

.....

.....

.....

Like the course? Get enrolled and start learning!

Reading Progress

0%


Vote for new content