debian-django-cachalot/docs/how.rst

23 lines
866 B
ReStructuredText
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

How django-cachalot works
-------------------------
.. note:: If you dont understand, you can pretend its magic.
Reverse engineering
...................
Its a lot of Django reverse engineering combined with a strong test suite.
Such a test suite is crucial for a reverse engineering project.
If some important part of Django changes and breaks the expected behaviour,
you can be sure that the test suite will fail.
Monkey patching
...............
Django-cachalot modifies Django in place during execution to add a caching tool
just before SQL queries are executed.
When a SQL query reads data, we save the result in cache. If that same query is
executed later, we fetch that result from cache.
When we detect ``INSERT``, ``UPDATE`` or ``DELETE``, we know which tables are
modified. All the previous cached queries can therefore be safely invalidated.