Skip to content

Commit d0b5213

Browse files
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
1 parent e41150a commit d0b5213

File tree

11 files changed

+47
-29
lines changed

11 files changed

+47
-29
lines changed

.github/ISSUE_TEMPLATE/question.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: Question
3-
about: Ask a generic/specific question here or on the Slack chat
3+
about: Ask a generic/specific question here or on the Discord chat
44
---
55

66
## Question

CHANGELOG.rst

+12-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
What’s new in django-cachalot?
22
==============================
33

4+
2.3.3
5+
-----
6+
7+
- Remove deprecated signal argument (#165)
8+
- Add Python 3.9 support
9+
- Use Discord instead since Slack doesn't save messages,
10+
@Andrew-Chen-Wang is not on there very much, and Discord
11+
has a phenomenal search functionality (with ES).
12+
413
2.3.2
514
-----
615

@@ -28,7 +37,9 @@ What’s new in django-cachalot?
2837

2938
- Adds Django 2.2 and 3.0 support.
3039
- Dropped official support for Python 3.4
31-
- It won't run properly with Travis CI tests on MySQL.
40+
41+
- It won't run properly with Travis CI tests on MySQL.
42+
3243
- All Travis CI tests are fully functional.
3344

3445
2.1.0

README.rst

+10-7
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ Documentation: http://django-cachalot.readthedocs.io
2222
.. image:: http://img.shields.io/scrutinizer/g/noripyt/django-cachalot/master.svg?style=flat-square&maxAge=3600
2323
:target: https://scrutinizer-ci.com/g/noripyt/django-cachalot/
2424

25-
.. image:: https://img.shields.io/badge/cachalot-Chat%20on%20Slack-green?style=flat&logo=slack
26-
:target: https://join.slack.com/t/cachalotdjango/shared_invite/zt-dd0tj27b-cIH6VlaSOjAWnTG~II5~qw
25+
.. image:: https://img.shields.io/discord/773656139207802881
26+
:target: https://discord.gg/WFGFBk8rSU
2727

2828
----
2929

@@ -39,7 +39,7 @@ Table of Contents:
3939
Quickstart
4040
----------
4141

42-
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.
42+
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.
4343

4444
Usage
4545
-----
@@ -99,7 +99,7 @@ Third-Party Cache Comparison
9999

100100
There are three main third party caches: cachalot, cache-machine, and cache-ops. Which do you use? We suggest a mix:
101101

102-
TL;DR Use cachalot for cold or modified <50 times per seconds (Most people should stick with only cachalot since you
102+
TL;DR Use cachalot for cold or modified <50 times per minutes (Most people should stick with only cachalot since you
103103
most likely won't need to scale to the point of needing cache-machine added to the bowl). If you're an enterprise that
104104
already has huge statistics, then mixing cold caches for cachalot and your hot caches with cache-machine is the best
105105
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
113113
Django (also authored but work-in-progress by `Andrew Chen Wang`_), then the caching will work better since sharding
114114
the cold/accessed-the-least records aren't invalidated as much.
115115

116-
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,
116+
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,
117117
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
118118
invalidates those individual objects instead of the entire table like cachalot.
119119

@@ -129,9 +129,12 @@ Note 2: Technical comparison: https://django-cachalot.readthedocs.io/en/latest/i
129129
Discussion
130130
----------
131131

132-
Help? Technical chat? `It's here on Slack <https://join.slack.com/t/cachalotdjango/shared_invite/zt-dd0tj27b-cIH6VlaSOjAWnTG~II5~qw>`_.
132+
Help? Technical chat? `It's here on Discord <https://discord.gg/WFGFBk8rSU>`_.
133133

134-
Legacy chat: https://gitter.im/django-cachalot/Lobby
134+
Legacy chats:
135+
136+
- https://gitter.im/django-cachalot/Lobby
137+
- https://join.slack.com/t/cachalotdjango/shared_invite/zt-dd0tj27b-cIH6VlaSOjAWnTG~II5~qw
135138

136139
.. _Andrew Chen Wang: https://github.com/Andrew-Chen-Wang
137140

cachalot/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
VERSION = (2, 3, 2)
1+
VERSION = (2, 3, 3)
22
__version__ = '.'.join(map(str, VERSION))
33

44
default_app_config = 'cachalot.apps.CachalotConfig'

cachalot/api.py

+12-9
Original file line numberDiff line numberDiff line change
@@ -142,15 +142,18 @@ def cachalot_disabled(all_queries=False):
142142
the variable that saved it in-memory.
143143
144144
For example:
145-
with cachalot_disabled():
146-
qs = Test.objects.filter(blah=blah)
147-
# Does a single query to the db
148-
list(qs) # Evaluates queryset
149-
# Because the qs was evaluated, it's
150-
# saved in memory:
151-
list(qs) # this does 0 queries.
152-
# This does 1 query to the db
153-
list(Test.objects.filter(blah=blah))
145+
146+
.. code-block:: python
147+
148+
with cachalot_disabled():
149+
qs = Test.objects.filter(blah=blah)
150+
# Does a single query to the db
151+
list(qs) # Evaluates queryset
152+
# Because the qs was evaluated, it's
153+
# saved in memory:
154+
list(qs) # this does 0 queries.
155+
# This does 1 query to the db
156+
list(Test.objects.filter(blah=blah))
154157
155158
If you evaluate the queryset outside the context manager, any duplicate
156159
query will use the cached result unless an object creation happens in between

docs/index.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ Caches your Django ORM queries and automatically invalidates them.
2020
.. image:: http://img.shields.io/scrutinizer/g/noripyt/django-cachalot/master.svg?style=flat-square&maxAge=3600
2121
:target: https://scrutinizer-ci.com/g/noripyt/django-cachalot/
2222

23-
.. image:: https://img.shields.io/badge/cachalot-Chat%20on%20Slack-green?style=flat&logo=slack
24-
:target: https://join.slack.com/t/cachalotdjango/shared_invite/zt-dd0tj27b-cIH6VlaSOjAWnTG~II5~qw
23+
.. image:: https://img.shields.io/discord/773656139207802881
24+
:target: https://discord.gg/WFGFBk8rSU
2525

2626
Usage
2727
.....
@@ -64,7 +64,7 @@ In-depth opinion (from new maintainer):
6464

6565
There are three main third party caches: cachalot, cache-machine, and cache-ops. Which do you use? We suggest a mix:
6666

67-
TL;DR Use cachalot for cold or modified <50 times per seconds (Most people should stick with only cachalot since you
67+
TL;DR Use cachalot for cold or modified <50 times per minutes (Most people should stick with only cachalot since you
6868
most likely won't need to scale to the point of needing cache-machine added to the bowl). If you're an enterprise that
6969
already has huge statistics, then mixing cold caches for cachalot and your hot caches with cache-machine is the best
7070
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
7878
Django (also authored but work-in-progress by `Andrew Chen Wang <https://github.com/Andrew-Chen-Wang>`_),
7979
then the caching will work better since sharding the cold/accessed-the-least records aren't invalidated as much.
8080

81-
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,
81+
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,
8282
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
8383
invalidates those individual objects instead of the entire table like cachalot.
8484

docs/introduction.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ if you need to be convinced). One of the best suited is ``select_related`` and
1717
``prefetch_related`` operations.
1818

1919
However, it’s not suited for projects where there is **a high number
20-
of modifications per second** on each table, like a social network with
21-
more than a 50 messages per second. Django-cachalot may still give a small
20+
of modifications per minute** on each table, like a social network with
21+
more than a 50 messages per minute. Django-cachalot may still give a small
2222
speedup in such cases, but it may also slow things a bit
2323
(in the worst case scenario, a 20% slowdown,
2424
according to :ref:`the benchmark <Benchmark>`).

docs/limits.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ High rate of database modifications
77
...................................
88

99
Do not use django-cachalot if your project has more than 50 database
10-
modifications per second on most of its tables. There will be no problem,
10+
modifications per minute on most of its tables. There will be no problem,
1111
but django-cachalot will become inefficient and will end up slowing
1212
your project instead of speeding it.
1313
Read :ref:`the introduction <Introduction>` for more details.

docs/quickstart.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Requirements
55
............
66

77
- Django 2.0-2.2, 3.0-3.1
8-
- Python 3.5-3.8
8+
- Python 3.5-3.9
99
- a cache configured as ``'default'`` with one of these backends:
1010

1111
- `django-redis <https://github.com/niwinz/django-redis>`_

docs/reporting.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ Bug reports, questions, discussion, new features
77
`on GitHub <https://github.com/noripyt/django-cachalot/issues>`_
88
- If you have **a question** on how django-cachalot works
99
or to **simply discuss**,
10-
`chat with us on Slack <https://join.slack.com/t/cachalotdjango/shared_invite/zt-dd0tj27b-cIH6VlaSOjAWnTG~II5~qw>`_.
10+
`chat with us on Discord <https://discord.gg/WFGFBk8rSU>`_.
1111
- If you want **to add a feature**:
1212

1313
- if you have an idea on how to implement it, you can fork the project
1414
and send a pull request, but **please open an issue first**, because
1515
someone else could already be working on it
1616
- if you’re sure that it’s a must-have feature, open an issue
1717
- if it’s just a vague idea, please
18-
`ask on Slack <https://join.slack.com/t/cachalotdjango/shared_invite/zt-dd0tj27b-cIH6VlaSOjAWnTG~II5~qw>`_ first
18+
`ask on Discord <https://discord.gg/WFGFBk8rSU>`_ first

setup.py

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
'Programming Language :: Python :: 3.6',
3737
'Programming Language :: Python :: 3.7',
3838
'Programming Language :: Python :: 3.8',
39+
'Programming Language :: Python :: 3.9',
3940
'Topic :: Internet :: WWW/HTTP',
4041
],
4142
license='BSD',

0 commit comments

Comments
 (0)