mirror of
https://github.com/Hopiu/django-cachalot.git
synced 2026-05-04 02:44:43 +00:00
v2.3.3
* Fix a comment block disabling incorrectly RST form for cachalot_disabled * Update CHANGELOG.rst * Several points did I incorrectly say that 50 modifications per second was too much. It was supposed to say minute. You'd have to have a LARGE website to really get to that point since inserts from an external DB would typically take a 250-1000ms/1s per INSERT/UPDATE * Add Python 3.9 support in the docs and setup.py * Move chat to Discord and reflect in the docs
This commit is contained in:
parent
e41150abd5
commit
d0b5213014
11 changed files with 47 additions and 29 deletions
2
.github/ISSUE_TEMPLATE/question.md
vendored
2
.github/ISSUE_TEMPLATE/question.md
vendored
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
name: Question
|
||||
about: Ask a generic/specific question here or on the Slack chat
|
||||
about: Ask a generic/specific question here or on the Discord chat
|
||||
---
|
||||
|
||||
## Question
|
||||
|
|
|
|||
|
|
@ -1,6 +1,15 @@
|
|||
What’s new in django-cachalot?
|
||||
==============================
|
||||
|
||||
2.3.3
|
||||
-----
|
||||
|
||||
- Remove deprecated signal argument (#165)
|
||||
- Add Python 3.9 support
|
||||
- Use Discord instead since Slack doesn't save messages,
|
||||
@Andrew-Chen-Wang is not on there very much, and Discord
|
||||
has a phenomenal search functionality (with ES).
|
||||
|
||||
2.3.2
|
||||
-----
|
||||
|
||||
|
|
@ -28,7 +37,9 @@ What’s new in django-cachalot?
|
|||
|
||||
- Adds Django 2.2 and 3.0 support.
|
||||
- Dropped official support for Python 3.4
|
||||
- It won't run properly with Travis CI tests on MySQL.
|
||||
|
||||
- It won't run properly with Travis CI tests on MySQL.
|
||||
|
||||
- All Travis CI tests are fully functional.
|
||||
|
||||
2.1.0
|
||||
|
|
|
|||
17
README.rst
17
README.rst
|
|
@ -22,8 +22,8 @@ Documentation: http://django-cachalot.readthedocs.io
|
|||
.. image:: http://img.shields.io/scrutinizer/g/noripyt/django-cachalot/master.svg?style=flat-square&maxAge=3600
|
||||
:target: https://scrutinizer-ci.com/g/noripyt/django-cachalot/
|
||||
|
||||
.. image:: https://img.shields.io/badge/cachalot-Chat%20on%20Slack-green?style=flat&logo=slack
|
||||
:target: https://join.slack.com/t/cachalotdjango/shared_invite/zt-dd0tj27b-cIH6VlaSOjAWnTG~II5~qw
|
||||
.. image:: https://img.shields.io/discord/773656139207802881
|
||||
:target: https://discord.gg/WFGFBk8rSU
|
||||
|
||||
----
|
||||
|
||||
|
|
@ -39,7 +39,7 @@ Table of Contents:
|
|||
Quickstart
|
||||
----------
|
||||
|
||||
Cachalot officially supports Python 3.5-3.8 and Django 2.0-2.2, 3.0-3.1 with the databases PostgreSQL, SQLite, and MySQL.
|
||||
Cachalot officially supports Python 3.5-3.9 and Django 2.0-2.2, 3.0-3.1 with the databases PostgreSQL, SQLite, and MySQL.
|
||||
|
||||
Usage
|
||||
-----
|
||||
|
|
@ -99,7 +99,7 @@ Third-Party Cache Comparison
|
|||
|
||||
There are three main third party caches: cachalot, cache-machine, and cache-ops. Which do you use? We suggest a mix:
|
||||
|
||||
TL;DR Use cachalot for cold or modified <50 times per seconds (Most people should stick with only cachalot since you
|
||||
TL;DR Use cachalot for cold or modified <50 times per minutes (Most people should stick with only cachalot since you
|
||||
most likely won't need to scale to the point of needing cache-machine added to the bowl). If you're an enterprise that
|
||||
already has huge statistics, then mixing cold caches for cachalot and your hot caches with cache-machine is the best
|
||||
mix. However, when performing joins with ``select_related`` and ``prefetch_related``, you can
|
||||
|
|
@ -113,7 +113,7 @@ Cachalot is more-or-less intended for cold caches or "just-right" conditions. If
|
|||
Django (also authored but work-in-progress by `Andrew Chen Wang`_), then the caching will work better since sharding
|
||||
the cold/accessed-the-least records aren't invalidated as much.
|
||||
|
||||
Cachalot is good when there are <50 modifications per second on a hot cached table. This is mostly due to cache invalidation. It's the same with any cache,
|
||||
Cachalot is good when there are <50 modifications per minute on a hot cached table. This is mostly due to cache invalidation. It's the same with any cache,
|
||||
which is why we suggest you use cache-machine for hot caches. Cache-machine caches individual objects, taking up more in the memory store but
|
||||
invalidates those individual objects instead of the entire table like cachalot.
|
||||
|
||||
|
|
@ -129,9 +129,12 @@ Note 2: Technical comparison: https://django-cachalot.readthedocs.io/en/latest/i
|
|||
Discussion
|
||||
----------
|
||||
|
||||
Help? Technical chat? `It's here on Slack <https://join.slack.com/t/cachalotdjango/shared_invite/zt-dd0tj27b-cIH6VlaSOjAWnTG~II5~qw>`_.
|
||||
Help? Technical chat? `It's here on Discord <https://discord.gg/WFGFBk8rSU>`_.
|
||||
|
||||
Legacy chat: https://gitter.im/django-cachalot/Lobby
|
||||
Legacy chats:
|
||||
|
||||
- https://gitter.im/django-cachalot/Lobby
|
||||
- https://join.slack.com/t/cachalotdjango/shared_invite/zt-dd0tj27b-cIH6VlaSOjAWnTG~II5~qw
|
||||
|
||||
.. _Andrew Chen Wang: https://github.com/Andrew-Chen-Wang
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
VERSION = (2, 3, 2)
|
||||
VERSION = (2, 3, 3)
|
||||
__version__ = '.'.join(map(str, VERSION))
|
||||
|
||||
default_app_config = 'cachalot.apps.CachalotConfig'
|
||||
|
|
|
|||
|
|
@ -142,15 +142,18 @@ def cachalot_disabled(all_queries=False):
|
|||
the variable that saved it in-memory.
|
||||
|
||||
For example:
|
||||
with cachalot_disabled():
|
||||
qs = Test.objects.filter(blah=blah)
|
||||
# Does a single query to the db
|
||||
list(qs) # Evaluates queryset
|
||||
# Because the qs was evaluated, it's
|
||||
# saved in memory:
|
||||
list(qs) # this does 0 queries.
|
||||
# This does 1 query to the db
|
||||
list(Test.objects.filter(blah=blah))
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
with cachalot_disabled():
|
||||
qs = Test.objects.filter(blah=blah)
|
||||
# Does a single query to the db
|
||||
list(qs) # Evaluates queryset
|
||||
# Because the qs was evaluated, it's
|
||||
# saved in memory:
|
||||
list(qs) # this does 0 queries.
|
||||
# This does 1 query to the db
|
||||
list(Test.objects.filter(blah=blah))
|
||||
|
||||
If you evaluate the queryset outside the context manager, any duplicate
|
||||
query will use the cached result unless an object creation happens in between
|
||||
|
|
|
|||
|
|
@ -20,8 +20,8 @@ Caches your Django ORM queries and automatically invalidates them.
|
|||
.. image:: http://img.shields.io/scrutinizer/g/noripyt/django-cachalot/master.svg?style=flat-square&maxAge=3600
|
||||
:target: https://scrutinizer-ci.com/g/noripyt/django-cachalot/
|
||||
|
||||
.. image:: https://img.shields.io/badge/cachalot-Chat%20on%20Slack-green?style=flat&logo=slack
|
||||
:target: https://join.slack.com/t/cachalotdjango/shared_invite/zt-dd0tj27b-cIH6VlaSOjAWnTG~II5~qw
|
||||
.. image:: https://img.shields.io/discord/773656139207802881
|
||||
:target: https://discord.gg/WFGFBk8rSU
|
||||
|
||||
Usage
|
||||
.....
|
||||
|
|
@ -64,7 +64,7 @@ In-depth opinion (from new maintainer):
|
|||
|
||||
There are three main third party caches: cachalot, cache-machine, and cache-ops. Which do you use? We suggest a mix:
|
||||
|
||||
TL;DR Use cachalot for cold or modified <50 times per seconds (Most people should stick with only cachalot since you
|
||||
TL;DR Use cachalot for cold or modified <50 times per minutes (Most people should stick with only cachalot since you
|
||||
most likely won't need to scale to the point of needing cache-machine added to the bowl). If you're an enterprise that
|
||||
already has huge statistics, then mixing cold caches for cachalot and your hot caches with cache-machine is the best
|
||||
mix. However, when performing joins with select_related and prefetch_related, you can
|
||||
|
|
@ -78,7 +78,7 @@ Cachalot is more-or-less intended for cold caches or "just-right" conditions. If
|
|||
Django (also authored but work-in-progress by `Andrew Chen Wang <https://github.com/Andrew-Chen-Wang>`_),
|
||||
then the caching will work better since sharding the cold/accessed-the-least records aren't invalidated as much.
|
||||
|
||||
Cachalot is good when there are <50 modifications per second on a hot cached table. This is mostly due to cache invalidation. It's the same with any cache,
|
||||
Cachalot is good when there are <50 modifications per minute on a hot cached table. This is mostly due to cache invalidation. It's the same with any cache,
|
||||
which is why we suggest you use cache-machine for hot caches. Cache-machine caches individual objects, taking up more in the memory store but
|
||||
invalidates those individual objects instead of the entire table like cachalot.
|
||||
|
||||
|
|
|
|||
|
|
@ -17,8 +17,8 @@ if you need to be convinced). One of the best suited is ``select_related`` and
|
|||
``prefetch_related`` operations.
|
||||
|
||||
However, it’s not suited for projects where there is **a high number
|
||||
of modifications per second** on each table, like a social network with
|
||||
more than a 50 messages per second. Django-cachalot may still give a small
|
||||
of modifications per minute** on each table, like a social network with
|
||||
more than a 50 messages per minute. Django-cachalot may still give a small
|
||||
speedup in such cases, but it may also slow things a bit
|
||||
(in the worst case scenario, a 20% slowdown,
|
||||
according to :ref:`the benchmark <Benchmark>`).
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ High rate of database modifications
|
|||
...................................
|
||||
|
||||
Do not use django-cachalot if your project has more than 50 database
|
||||
modifications per second on most of its tables. There will be no problem,
|
||||
modifications per minute 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.
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ Requirements
|
|||
............
|
||||
|
||||
- Django 2.0-2.2, 3.0-3.1
|
||||
- Python 3.5-3.8
|
||||
- Python 3.5-3.9
|
||||
- a cache configured as ``'default'`` with one of these backends:
|
||||
|
||||
- `django-redis <https://github.com/niwinz/django-redis>`_
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ Bug reports, questions, discussion, new features
|
|||
`on GitHub <https://github.com/noripyt/django-cachalot/issues>`_
|
||||
- If you have **a question** on how django-cachalot works
|
||||
or to **simply discuss**,
|
||||
`chat with us on Slack <https://join.slack.com/t/cachalotdjango/shared_invite/zt-dd0tj27b-cIH6VlaSOjAWnTG~II5~qw>`_.
|
||||
`chat with us on Discord <https://discord.gg/WFGFBk8rSU>`_.
|
||||
- If you want **to add a feature**:
|
||||
|
||||
- if you have an idea on how to implement it, you can fork the project
|
||||
|
|
@ -15,4 +15,4 @@ Bug reports, questions, discussion, new features
|
|||
someone else could already be working on it
|
||||
- if you’re sure that it’s a must-have feature, open an issue
|
||||
- if it’s just a vague idea, please
|
||||
`ask on Slack <https://join.slack.com/t/cachalotdjango/shared_invite/zt-dd0tj27b-cIH6VlaSOjAWnTG~II5~qw>`_ first
|
||||
`ask on Discord <https://discord.gg/WFGFBk8rSU>`_ first
|
||||
|
|
|
|||
1
setup.py
1
setup.py
|
|
@ -36,6 +36,7 @@ setup(
|
|||
'Programming Language :: Python :: 3.6',
|
||||
'Programming Language :: Python :: 3.7',
|
||||
'Programming Language :: Python :: 3.8',
|
||||
'Programming Language :: Python :: 3.9',
|
||||
'Topic :: Internet :: WWW/HTTP',
|
||||
],
|
||||
license='BSD',
|
||||
|
|
|
|||
Loading…
Reference in a new issue