Adds a « Do not use if… » documentation paragraph.

This commit is contained in:
Bertrand Bordage 2016-09-13 13:51:22 +02:00
parent f1093935d2
commit 62cb9c5c78
4 changed files with 24 additions and 5 deletions

View File

@ -1,3 +1,5 @@
.. _Introduction:
Introduction
------------
@ -10,7 +12,7 @@ In fact, **the more visitors you have, the faster the website becomes**.
Thats because every possible SQL query on the project ends up being cached.
Django-cachalot is especially efficient in the Django administration website
since its unfortunately badly optimised (use foreign keys in list_editable
since its unfortunately badly optimised (use foreign keys in ``list_editable``
if you need to be convinced).
However, its not suited for projects where there is **a high number

View File

@ -1,8 +1,25 @@
.. _limits:
.. _Limits:
Limits
------
Do not use if:
..............
- Your project runs on several servers **and** each server is connected to
the same database **and** each server uses a different cache **and**
each server cannot have access to all other caches. **However if each server
can have access to all other caches**, simply specify all other caches as
non-default in the ``CACHES`` setting. This way, django-cachalot will
automatically invalidate all other caches when something changed in the
database. Otherwise, django-cachalot has no way to know on a given server
that another server triggered a database change, and it will therefore serve
stale data because the cache of the given server was not invalidated.
- Your project has more than 50 database modifications per second on most of
its tables. There will be no problem, but django-cachalot will become
inefficient and will end up slowing your project instead of speeding it.
Read :ref:`the introduction <Introduction>` for more details.
Redis
.....
@ -91,7 +108,7 @@ and then invalidates the tables contained in that query by comparing
with models registered by Django.
This is quite robust, so if a query is not invalidated automatically
by this system, please :ref:`send a bug report <reporting>`.
by this system, please :ref:`send a bug report <Reporting>`.
In the meantime, you can use :ref:`the API <API>` to manually invalidate
the tables where data has changed.

View File

@ -32,7 +32,7 @@ Usage
#. If you modify data outside Django
 typically after restoring a SQL database , run
``./manage.py invalidate_cachalot``
#. Be aware of :ref:`the few other limits <limits>`
#. Be aware of :ref:`the few other limits <Limits>`
#. If you use
`django-debug-toolbar <https://github.com/django-debug-toolbar/django-debug-toolbar>`_,
you can add ``'cachalot.panels.CachalotPanel',``

View File

@ -1,4 +1,4 @@
.. _reporting:
.. _Reporting:
Bug reports, questions, discussion, new features
------------------------------------------------