From 689f679ad30c5d98960b6e53fb0efb1d6e45a941 Mon Sep 17 00:00:00 2001 From: Andrew-Chen-Wang Date: Mon, 10 Aug 2020 17:15:13 -0400 Subject: [PATCH] v2.3.1 --- CHANGELOG.rst | 5 +++++ CONTRIBUTING.rst | 17 +++++++++++++++++ README.rst | 9 +++++++-- cachalot/__init__.py | 2 +- docs/index.rst | 3 ++- docs/introduction.rst | 3 ++- docs/quickstart.rst | 2 +- setup.py | 2 +- 8 files changed, 36 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 32d9101..aa5eb42 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,6 +1,11 @@ What’s new in django-cachalot? ============================== +2.3.1 +----- + +- Added support for Django 3.1, including the new, native JSONField + 2.3.0 ----- diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 94d9f5e..47749c1 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -4,3 +4,20 @@ We appreciate any support in improvements to this system in performance, erasing dependency errors, or in killing bugs. When you start a PR or issue, please follow the layout provided. + +To start developing, install the requirements +and run the tests via tox. + +Make sure you have the following services: + +* Memcached +* Redis +* PostgreSQL +* MySQL + +For setup: + +#. Install: ``pip install -r requirements/hacking.txt`` +#. For PostgreSQL: ``CREATE ROLE cachalot LOGIN SUPERUSER;`` +#. Run: ``tox --current-env`` to run the test suite on your current Python version. +#. You can also run specific databases and Django versions: ``tox -e py38-django3.1-postgresql-redis`` diff --git a/README.rst b/README.rst index f355d45..94db463 100644 --- a/README.rst +++ b/README.rst @@ -10,6 +10,9 @@ Documentation: http://django-cachalot.readthedocs.io .. image:: http://img.shields.io/pypi/v/django-cachalot.svg?style=flat-square&maxAge=3600 :target: https://pypi.python.org/pypi/django-cachalot +.. image:: https://img.shields.io/pypi/pyversions/django-cachalot + :target: https://django-cachalot.readthedocs.io/en/latest/ + .. image:: https://travis-ci.com/noripyt/django-cachalot.svg?branch=master :target: https://travis-ci.com/noripyt/django-cachalot @@ -36,7 +39,7 @@ Table of Contents: Quickstart ---------- -Cachalot officially supports Python 3.5-3.8 and Django 2.0-2.2, 3.0 with the databases PostgreSQL, SQLite, and MySQL. +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. Usage ----- @@ -73,6 +76,7 @@ For setup: #. Install: ``pip install -r requirements/hacking.txt`` #. For PostgreSQL: ``CREATE ROLE cachalot LOGIN SUPERUSER;`` #. Run: ``tox --current-env`` to run the test suite on your current Python version. +#. You can also run specific databases and Django versions: ``tox -e py38-django3.1-postgresql-redis`` Benchmark --------- @@ -98,7 +102,8 @@ There are three main third party caches: cachalot, cache-machine, and cache-ops. TL;DR Use cachalot for cold or modified <50 times per seconds (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. +mix. However, when performing joins with ``select_related`` and ``prefetch_related``, you can +get a nearly 100x speed up for your initial deployment. Recall, cachalot caches THE ENTIRE TABLE. That's where its inefficiency stems from: if you keep updating the records, then the cachalot constantly invalidates the table and re-caches. Luckily caching is very efficient, it's just the cache diff --git a/cachalot/__init__.py b/cachalot/__init__.py index 9879a16..cc92ff5 100644 --- a/cachalot/__init__.py +++ b/cachalot/__init__.py @@ -1,4 +1,4 @@ -VERSION = (2, 3, 0) +VERSION = (2, 3, 1) __version__ = '.'.join(map(str, VERSION)) default_app_config = 'cachalot.apps.CachalotConfig' diff --git a/docs/index.rst b/docs/index.rst index ae44035..4e7583c 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -67,7 +67,8 @@ There are three main third party caches: cachalot, cache-machine, and cache-ops. TL;DR Use cachalot for cold or modified <50 times per seconds (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. +mix. However, when performing joins with select_related and prefetch_related, you can +get a nearly 100x speed up for your initial deployment. Recall, cachalot caches THE ENTIRE TABLE. That's where its inefficiency stems from: if you keep updating the records, then the cachalot constantly invalidates the table and re-caches. Luckily caching is very efficient, it's just the cache diff --git a/docs/introduction.rst b/docs/introduction.rst index 488ff89..9ea8173 100644 --- a/docs/introduction.rst +++ b/docs/introduction.rst @@ -13,7 +13,8 @@ That’s because every possible SQL query on the project ends up being cached. Django-cachalot is especially efficient in the Django administration website since it’s unfortunately badly optimised (use foreign keys in ``list_editable`` -if you need to be convinced). +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 diff --git a/docs/quickstart.rst b/docs/quickstart.rst index 21946f4..09a5e39 100644 --- a/docs/quickstart.rst +++ b/docs/quickstart.rst @@ -4,7 +4,7 @@ Quick start Requirements ............ -- Django 2.0-2.2, or 3.0 +- Django 2.0-2.2, 3.0-3.1 - Python 3.5-3.8 - a cache configured as ``'default'`` with one of these backends: diff --git a/setup.py b/setup.py index de9585a..e6e79a9 100755 --- a/setup.py +++ b/setup.py @@ -30,8 +30,8 @@ setup( 'Framework :: Django :: 2.1', 'Framework :: Django :: 2.2', 'Framework :: Django :: 3.0', + 'Framework :: Django :: 3.1', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7',