| 1 |
What’s new in django-cachalot? |
| 2 |
============================== |
| 3 |
2.9.1 |
| 4 |
----- |
| 5 |
- Add support for Django 6.1 |
| 6 |
|
| 7 |
2.9.0 |
| 8 |
----- |
| 9 |
- Add support for Django 6.0 and Python 3.8-3.14 (#277) |
| 10 |
- Fix #280 CachalotPanel not working in Django Debug Toolbar (#277) |
| 11 |
- Fix Recursion Issue in AtomicCache (Issue #274) |
| 12 |
- Allow custom databases (#247) |
| 13 |
|
| 14 |
2.8.0 |
| 15 |
----- |
| 16 |
- Add a setting for disabling iterator caching (#263) |
| 17 |
- Add support for testing against the builtin redis backend (#264) |
| 18 |
- Add Django 5.2 support to tox configuration (#272) |
| 19 |
|
| 20 |
2.7.0 |
| 21 |
----- |
| 22 |
|
| 23 |
- Add support for caching queries with enum filters (#267) |
| 24 |
|
| 25 |
2.6.3 |
| 26 |
----- |
| 27 |
|
| 28 |
- Support for Django 5.1 |
| 29 |
|
| 30 |
2.6.2 |
| 31 |
----- |
| 32 |
|
| 33 |
- Support for Python 3.12 and Django 5.0 |
| 34 |
|
| 35 |
2.6.1 |
| 36 |
----- |
| 37 |
|
| 38 |
- Hot fix when Django is externally imported due to connections import (#242) |
| 39 |
|
| 40 |
2.6.0 |
| 41 |
----- |
| 42 |
|
| 43 |
- Dropped Django 2.2 and 4.0 support |
| 44 |
- Added Django 4.2 and Python 3.11 support |
| 45 |
- Added psycopg support (#229) |
| 46 |
- Updated tests to account for the `BEGIN` and `COMMIT` query changes in Django 4.2 |
| 47 |
- Standardized django version comparisons in tests |
| 48 |
|
| 49 |
2.5.3 |
| 50 |
----- |
| 51 |
|
| 52 |
- Verify get_meta isn't none before requesting db_table (#225 #226) |
| 53 |
|
| 54 |
2.5.2 |
| 55 |
----- |
| 56 |
|
| 57 |
- Added Django 4.1 support (#217) |
| 58 |
|
| 59 |
2.5.1 |
| 60 |
----- |
| 61 |
|
| 62 |
- Table invalidation condition enhanced (#213) |
| 63 |
- Add test settings to sdist (#203) |
| 64 |
- Include docs in sdist (#202) |
| 65 |
|
| 66 |
2.5.0 |
| 67 |
----- |
| 68 |
|
| 69 |
- Add final SQL check to include potentially overlooked tables when looking up involved tables (#199) |
| 70 |
- Add ``CACHALOT_FINAL_SQL_CHECK`` for enabling Final SQL check |
| 71 |
|
| 72 |
2.4.5 |
| 73 |
----- |
| 74 |
|
| 75 |
- Dropped Python 3.6 and Django 3.1 support. Added Django 4.0 support (#208) |
| 76 |
|
| 77 |
2.4.4 |
| 78 |
----- |
| 79 |
|
| 80 |
- Handle queryset implementations without lhs/rhs attribute (#204) |
| 81 |
- Add Python 3.10 support (#206) |
| 82 |
- (Internal) Omit additional unnecessary code in coverage |
| 83 |
|
| 84 |
2.4.3 |
| 85 |
----- |
| 86 |
|
| 87 |
- Fix annotated Now being cached (#195) |
| 88 |
- Fix conditional annotated expressions not being cached (#196) |
| 89 |
- Simplify annotation handling by using the flatten method (#197) |
| 90 |
- Fix Django 3.2 default_app_config deprecation (#198) |
| 91 |
- (Internal) Pinned psycopg2 to <2.9 due to Django 2.2 incompatibility |
| 92 |
|
| 93 |
2.4.2 |
| 94 |
----- |
| 95 |
|
| 96 |
- Add convenience settings `CACHALOT_ONLY_CACHABLE_APPS` |
| 97 |
and `CACHALOT_UNCACHABLE_APPS` (#187) |
| 98 |
- Drop support for Django 3.0 (#189) |
| 99 |
- (Internal) Added Django main-branch CI on cron job |
| 100 |
- (Internal) Removed duplicate code (#190) |
| 101 |
|
| 102 |
2.4.1 |
| 103 |
----- |
| 104 |
|
| 105 |
- Fix Django requirement constraint to include 3.2.X not just 3.2 |
| 106 |
- (Internal) Deleted obsolete travis-matrix.py file |
| 107 |
|
| 108 |
2.4.0 |
| 109 |
----- |
| 110 |
|
| 111 |
- Add support for Django 3.2 (#181) |
| 112 |
- Remove enforced system check for Django version (#175) |
| 113 |
- Drop support for Django 2.0-2.1 and Python 3.5 (#181) |
| 114 |
- Add support for Pymemcache for Django 3.2+ (#181) |
| 115 |
- Reverts #157 with proper fix. (#181) |
| 116 |
- Add ``CACHALOT_ADDITIONAL_TABLES`` setting for unmanaged models (#183) |
| 117 |
|
| 118 |
2.3.5 |
| 119 |
----- |
| 120 |
|
| 121 |
- Fix cachalot_disabled (#174) |
| 122 |
|
| 123 |
2.3.4 |
| 124 |
----- |
| 125 |
|
| 126 |
- Fix bug with externally invalidated cache keys (#120) |
| 127 |
- Omit test files in coverage |
| 128 |
|
| 129 |
2.3.3 |
| 130 |
----- |
| 131 |
|
| 132 |
- Remove deprecated signal argument (#165) |
| 133 |
- Add Python 3.9 support |
| 134 |
- Use Discord instead since Slack doesn't save messages, |
| 135 |
@Andrew-Chen-Wang is not on there very much, and Discord |
| 136 |
has a phenomenal search functionality (with ES). |
| 137 |
|
| 138 |
2.3.2 |
| 139 |
----- |
| 140 |
|
| 141 |
- Cast memoryview objects to bytes to be able to pickle them (#163) |
| 142 |
|
| 143 |
2.3.1 |
| 144 |
----- |
| 145 |
|
| 146 |
- Added support for Django 3.1, including the new, native JSONField |
| 147 |
|
| 148 |
2.3.0 |
| 149 |
----- |
| 150 |
|
| 151 |
- Added context manager for temporarily disabling cachalot using `cachalot_disabled()` |
| 152 |
- Fix for certain Subquery cases. |
| 153 |
|
| 154 |
2.2.2 |
| 155 |
----- |
| 156 |
|
| 157 |
- Drop support for Django 1.11 and Python 2.7 |
| 158 |
- Added fix for subqueries from Django 2.2 |
| 159 |
|
| 160 |
2.2.0 |
| 161 |
----- |
| 162 |
|
| 163 |
- Adds Django 2.2 and 3.0 support. |
| 164 |
- Dropped official support for Python 3.4 |
| 165 |
|
| 166 |
- It won't run properly with Travis CI tests on MySQL. |
| 167 |
|
| 168 |
- All Travis CI tests are fully functional. |
| 169 |
|
| 170 |
2.1.0 |
| 171 |
----- |
| 172 |
|
| 173 |
- Adds Django 2.1 support. |
| 174 |
|
| 175 |
2.0.2 |
| 176 |
----- |
| 177 |
|
| 178 |
- Adds support for ``.union``, ``.intersection`` & ``.difference`` |
| 179 |
that should have been introduced since 1.5.0 |
| 180 |
- Fixes error raised in some rare and undetermined cases, when the cache |
| 181 |
backend doesn’t yield data as expected |
| 182 |
|
| 183 |
2.0.1 |
| 184 |
----- |
| 185 |
|
| 186 |
- Allows specifying a schema name in ``Model._meta.db_table`` |
| 187 |
|
| 188 |
2.0.0 |
| 189 |
----- |
| 190 |
|
| 191 |
- Adds Django 2.0 support |
| 192 |
- Drops Django 1.10 support |
| 193 |
- Drops Django 1.8 support (1.9 support was dropped in 1.5.0) |
| 194 |
- Adds a check to make sure it is used with a supported Django version |
| 195 |
- Fixes a bug partially breaking django-cachalot when an error occurred during |
| 196 |
the end of a `transaction.atomic` block, |
| 197 |
typically when using deferred constraints |
| 198 |
|
| 199 |
1.5.0 |
| 200 |
----- |
| 201 |
|
| 202 |
- Adds Django 1.11 support |
| 203 |
- Adds Python 3.6 support |
| 204 |
- Drops Django 1.9 support (but 1.8 is still supported) |
| 205 |
- Drops Python 3.3 support |
| 206 |
- Adds ``CACHALOT_DATABASES`` to specify which databases have django-cachalot |
| 207 |
enabled (by default, only supported databases are enabled) |
| 208 |
- Stops advising users to dynamically override cachalot settings as it cannot |
| 209 |
be thread-safe due to Django’s internals |
| 210 |
- Invalidates tables after raw ``CREATE``, ``ALTER`` & ``DROP`` SQL queries |
| 211 |
- Allows specifying model lookups like ``auth.User`` in the API functions |
| 212 |
(previously, it could only be done in the Django template tag, not in the |
| 213 |
Jinja2 ``get_last_invalidation`` function nor in API functions) |
| 214 |
- Fixes the cache used by ``CachalotPanel`` if ``CACHALOT_CACHE`` is different |
| 215 |
from ``'default'`` |
| 216 |
- Uploads a wheel distribution of this package to PyPI starting now, |
| 217 |
in addition of the source release |
| 218 |
- Improves tests |
| 219 |
|
| 220 |
1.4.1 |
| 221 |
----- |
| 222 |
|
| 223 |
- Fixes a circular import occurring when CachalotPanel is used |
| 224 |
and django-debug-toolbar is before django-cachalot in ``INSTALLED_APPS`` |
| 225 |
- Stops checking compatibility for caches other than ``CACHALOT_CACHE`` |
| 226 |
|
| 227 |
1.4.0 |
| 228 |
----- |
| 229 |
|
| 230 |
- Fixes a bad design: ``QuerySet.select_for_update`` was cached, but it’s not |
| 231 |
correct since it does not lock data in the database once data was cached, |
| 232 |
leading to the database lock being useless in some cases |
| 233 |
- Stops automatically invalidating other caches than ``CACHALOT_CACHE`` for |
| 234 |
consistency, performance, and usefulness reasons |
| 235 |
- Fixes a minor issue: the ``post_invalidation`` signal was sent during |
| 236 |
transactions when calling the ``invalidate`` command |
| 237 |
- Creates `a gitter chat room <https://gitter.im/django-cachalot/Lobby>`_ |
| 238 |
- Removes the Slack team. Slack does not allow public chat, this was therefore |
| 239 |
a bad idea |
| 240 |
|
| 241 |
1.3.0 |
| 242 |
----- |
| 243 |
|
| 244 |
- Adds Django 1.10 support |
| 245 |
- Drops Django 1.7 support |
| 246 |
- Drops Python 3.2 support |
| 247 |
- Adds a Jinja2 extension with a ``cache`` statement |
| 248 |
and the ``get_last_invalidation`` function |
| 249 |
- Adds a ``CACHALOT_TIMEOUT`` setting after dozens |
| 250 |
of private & public requests, but it’s not really useful |
| 251 |
- Fixes a ``RuntimeError`` occurring if a ``DatabaseCache`` was used in |
| 252 |
a project, even if not used by django-cachalot |
| 253 |
- Allows bytes raw queries (except on SQLite where it’s not supposed to work) |
| 254 |
- Creates `a Slack team <https://django-cachalot.slack.com>`_ to discuss, |
| 255 |
easier than using Google Groups |
| 256 |
|
| 257 |
1.2.1 |
| 258 |
----- |
| 259 |
|
| 260 |
**Mandatory update if you’re using django-cachalot 1.2.0.** |
| 261 |
|
| 262 |
This version reverts the cache keys hashing change from 1.2.0, |
| 263 |
as it was leading to a non-shared cache when Python used a random seed |
| 264 |
for hashing, which is the case by default on Python 3.3, 3.4, & 3.5, |
| 265 |
and also on 2.7 & 3.2 if you set ``PYTHONHASHSEED=random``. |
| 266 |
|
| 267 |
1.2.0 |
| 268 |
----- |
| 269 |
|
| 270 |
**WARNING: This version is unsafe, it can lead to invalidation errors** |
| 271 |
|
| 272 |
- Adds Django 1.9 support |
| 273 |
- Simplifies and speeds up cache keys hashing |
| 274 |
- Documents how to use django-cachalot with a replica database |
| 275 |
- Adds ``DummyCache`` to ``VALID_CACHE_BACKENDS`` |
| 276 |
- Updates the comparison with django-cache-machine & django-cacheops by |
| 277 |
checking features and measuring performance instead of relying on their |
| 278 |
documentations and a 2-years-ago experience of them |
| 279 |
|
| 280 |
1.1.0 |
| 281 |
----- |
| 282 |
|
| 283 |
**Backwards incompatible changes:** |
| 284 |
|
| 285 |
- Adds Django 1.8 support and drops Django 1.6 & Python 2.6 support |
| 286 |
- Merges the 3 API functions ``invalidate_all``, ``invalidate_tables``, |
| 287 |
& ``invalidate_models`` into a single ``invalidate`` function |
| 288 |
while optimising it |
| 289 |
|
| 290 |
Other additions: |
| 291 |
|
| 292 |
- Adds a ``get_last_invalidation`` function to the API and the equivalent |
| 293 |
template tag |
| 294 |
- Adds a ``CACHALOT_ONLY_CACHABLE_TABLES`` setting in order to make a whitelist |
| 295 |
of the only table names django-cachalot can cache |
| 296 |
- Caches queries with IP addresses, floats, or decimals in parameters |
| 297 |
- Adds a Django check to ensure the project uses |
| 298 |
compatible cache and database backends |
| 299 |
- Adds a lot of tests, especially to test django.contrib.postgres |
| 300 |
- Adds a comparison with django-cache-machine and django-cacheops |
| 301 |
in the documentation |
| 302 |
|
| 303 |
Fixed: |
| 304 |
|
| 305 |
- Removes a useless extra invalidation during each write operation |
| 306 |
to the database, leading to a small speedup |
| 307 |
during data modification and tests |
| 308 |
- The ``post_invalidation`` signal was triggered during transactions |
| 309 |
and was not triggered when using the API or raw write queries: both issues |
| 310 |
are now fixed |
| 311 |
- Fixes a very unlikely invalidation issue occurring only when an error |
| 312 |
occurred in a transaction after a transaction of another database nested |
| 313 |
in the first transaction was committed, like this: |
| 314 |
|
| 315 |
.. code:: python |
| 316 |
|
| 317 |
from django.db import transaction |
| 318 |
|
| 319 |
assert list(YourModel.objects.using('another_db')) == [] |
| 320 |
|
| 321 |
try: |
| 322 |
with transaction.atomic(): |
| 323 |
with transaction.atomic('another_db'): |
| 324 |
obj = YourModel.objects.using('another_db').create(name='test') |
| 325 |
raise ZeroDivisionError |
| 326 |
except ZeroDivisionError: |
| 327 |
pass |
| 328 |
|
| 329 |
# Before django-cachalot 1.1.0, this assert was failing. |
| 330 |
assert list(YourModel.objects.using('another_db')) == [obj] |
| 331 |
|
| 332 |
|
| 333 |
1.0.3 |
| 334 |
----- |
| 335 |
|
| 336 |
- Fixes an invalidation issue that could rarely occur when querying on a |
| 337 |
``BinaryField`` with PostgreSQL, or with some geographic queries |
| 338 |
(there was a small chance that a same query with different parameters |
| 339 |
could erroneously give the same result as the previous one) |
| 340 |
- Adds a ``CACHALOT_UNCACHABLE_TABLES`` setting |
| 341 |
- Fixes a Django 1.7 migrations invalidation issue in tests |
| 342 |
(that was leading to this error half of the time: |
| 343 |
``RuntimeError: Error creating new content types. Please make sure |
| 344 |
contenttypes is migrated before trying to migrate apps individually.``) |
| 345 |
- Optimises tests when using django-cachalot |
| 346 |
by avoid several useless cache invalidations |
| 347 |
|
| 348 |
|
| 349 |
1.0.2 |
| 350 |
----- |
| 351 |
|
| 352 |
- Fixes an ``AttributeError`` occurring when excluding through a many-to-many |
| 353 |
relation on a child model (using multi-table inheritance) |
| 354 |
- Stops caching queries with random subqueries – for example |
| 355 |
``User.objects.filter(pk__in=User.objects.order_by('?'))`` |
| 356 |
- Optimises automatic invalidation |
| 357 |
- Adds a note about clock synchronisation |
| 358 |
|
| 359 |
|
| 360 |
1.0.1 |
| 361 |
----- |
| 362 |
|
| 363 |
- Fixes an invalidation issue discovered by Helen Warren that was occurring |
| 364 |
when updating a ``ManyToManyField`` after executing using ``.exclude`` |
| 365 |
on that relation. For example, ``Permission.objects.all().delete()`` was not |
| 366 |
invalidating ``User.objects.exclude(user_permissions=None)`` |
| 367 |
- Fixes a ``UnicodeDecodeError`` introduced with python-memcached 1.54 |
| 368 |
- Adds a ``post_invalidation`` signal |
| 369 |
|
| 370 |
|
| 371 |
1.0.0 |
| 372 |
----- |
| 373 |
|
| 374 |
Fixes a bug occurring when caching a SQL query using a non-ascii table name. |
| 375 |
|
| 376 |
|
| 377 |
1.0.0rc |
| 378 |
------- |
| 379 |
|
| 380 |
Added: |
| 381 |
|
| 382 |
- Adds an `invalidate_cachalot` command to invalidate django-cachalot |
| 383 |
from a script without having to clear the whole cache |
| 384 |
- Adds the benchmark introduction, conditions & results to the documentation |
| 385 |
- Adds a short guide on how to configure Redis as a LRU cache |
| 386 |
|
| 387 |
Fixed: |
| 388 |
|
| 389 |
- Fixes a rare invalidation issue occurring when updating a many-to-many table |
| 390 |
after executing a queryset generating a ``HAVING`` SQL statement – |
| 391 |
for example, |
| 392 |
``User.objects.first().user_permissions.add(Permission.objects.first())`` |
| 393 |
was not invalidating |
| 394 |
``User.objects.annotate(n=Count('user_permissions')).filter(n__gte=1)`` |
| 395 |
- Fixes an even rarer invalidation issue occurring when updating a many-to-many |
| 396 |
table after executing a queryset filtering nested subqueries |
| 397 |
by another subquery through that many-to-many table – for example:: |
| 398 |
|
| 399 |
User.objects.filter( |
| 400 |
pk__in=User.objects.filter( |
| 401 |
pk__in=User.objects.filter( |
| 402 |
user_permissions__in=Permission.objects.all()))) |
| 403 |
|
| 404 |
- Avoids setting useless cache keys by using table names instead of |
| 405 |
Django-generated table alias |
| 406 |
|
| 407 |
|
| 408 |
0.9.0 |
| 409 |
----- |
| 410 |
|
| 411 |
Added: |
| 412 |
|
| 413 |
- Caches all queries implying ``Queryset.extra`` |
| 414 |
- Invalidates raw queries |
| 415 |
- Adds a simple API containing: |
| 416 |
``invalidate_tables``, ``invalidate_models``, ``invalidate_all`` |
| 417 |
- Adds file-based cache support for Django 1.7 |
| 418 |
- Adds a setting to choose if random queries must be cached |
| 419 |
- Adds 2 settings to customize how cache keys are generated |
| 420 |
- Adds a django-debug-toolbar panel |
| 421 |
- Adds a benchmark |
| 422 |
|
| 423 |
Fixed: |
| 424 |
|
| 425 |
- Rewrites invalidation for a better speed & memory performance |
| 426 |
- Fixes a stale cache issue occurring when an invalidation is done |
| 427 |
exactly during a SQL request on the invalidated table(s) |
| 428 |
- Fixes a stale cache issue occurring after concurrent transactions |
| 429 |
- Uses an infinite timeout |
| 430 |
|
| 431 |
Removed: |
| 432 |
|
| 433 |
- Simplifies ``cachalot_settings`` and forbids its use or modification |
| 434 |
|
| 435 |
|
| 436 |
0.8.1 |
| 437 |
----- |
| 438 |
|
| 439 |
- Fixes an issue with pip if Django is not yet installed |
| 440 |
|
| 441 |
|
| 442 |
0.8.0 |
| 443 |
----- |
| 444 |
|
| 445 |
- Adds multi-database support |
| 446 |
- Adds invalidation when altering the DB schema using `migrate`, `syncdb`, |
| 447 |
`flush`, `loaddata` commands (also invalidates South, if you use it) |
| 448 |
- Small optimizations & simplifications |
| 449 |
- Adds several tests |
| 450 |
|
| 451 |
|
| 452 |
0.7.0 |
| 453 |
----- |
| 454 |
|
| 455 |
- Adds thread-safety |
| 456 |
- Optimizes the amount of cache queries during transaction |
| 457 |
|
| 458 |
0.6.0 |
| 459 |
----- |
| 460 |
|
| 461 |
- Adds memcached support |
| 462 |
|
| 463 |
|
| 464 |
0.5.0 |
| 465 |
----- |
| 466 |
|
| 467 |
- Adds ``CACHALOT_ENABLED`` & ``CACHALOT_CACHE`` settings |
| 468 |
- Allows settings to be dynamically overridden using ``cachalot_settings`` |
| 469 |
- Adds some missing tests |
| 470 |
|
| 471 |
0.4.1 |
| 472 |
----- |
| 473 |
|
| 474 |
- Fixes ``pip install``. |
| 475 |
|
| 476 |
0.4.0 (**install broken**) |
| 477 |
-------------------------- |
| 478 |
|
| 479 |
- Adds Travis CI and adds compatibility for: |
| 480 |
|
| 481 |
- Django 1.6 & 1.7 |
| 482 |
- Python 2.6, 2.7, 3.2, 3.3, & 3.4 |
| 483 |
- locmem & Redis |
| 484 |
- SQLite, PostgreSQL, MySQL |
| 485 |
|
| 486 |
0.3.0 |
| 487 |
----- |
| 488 |
|
| 489 |
- Handles transactions |
| 490 |
- Adds lots of tests for complex cases |
| 491 |
|
| 492 |
0.2.0 |
| 493 |
----- |
| 494 |
|
| 495 |
- Adds a test suite |
| 496 |
- Fixes invalidation for data creation/deletion |
| 497 |
- Stops caching on queries defining ``select`` or ``where`` arguments |
| 498 |
with ``QuerySet.extra`` |
| 499 |
|
| 500 |
0.1.0 |
| 501 |
----- |
| 502 |
|
| 503 |
Prototype simply caching all SQL queries reading the database |
| 504 |
and trying to invalidate them when SQL queries modify the database. |
| 505 |
|
| 506 |
Has issues invalidating deletions and creations. |
| 507 |
Also caches ``QuerySet.extra`` queries but can’t reliably invalidate them. |
| 508 |
No transaction support, no test, no multi-database support, etc. |