{ "info": { "author": "Friedel Wolff", "author_email": "friedel@translate.org.za", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Framework :: Django", "Framework :: Django :: 1.11", "Framework :: Django :: 2.0", "Framework :: Django :: 2.1", "Intended Audience :: Developers", "License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Internet :: WWW/HTTP :: WSGI :: Middleware" ], "description": "===========================================================================\nDjango Compression Middleware\n===========================================================================\n\n\nThis middleware implements compressed content encoding for HTTP. It is similar\nto Django's ``GZipMiddleware`` (`documentation`_), but additionally supports\nother compression methods. It is meant to be a drop-in replacement for Django's\n``GZipMiddleware``. Its documentation \u2014 including security warnings \u2014 therefore\napply here as well.\n\nThe middleware is focussed on the task of compressing typical Django responses\nsuch as HTML, JSON, etc. Both normal (bulk) and streaming responses are\nsupported. For static file compression, have a look at other projects such as\n`WhiteNoise`_.\n\nZstandard is a new method for compression with little client support so far.\nMost browsers now support Brotli compression (check support status on `Can I\nuse... Brotli`_). The middleware will choose the best compression method\nsupported by the client as indicated in the request's ``Accept-Encoding``\nheader. In order of preference:\n\n- Zstandard\n- Brotli\n- gzip\n\nSummary of the project status:\n\n* .. image:: https://travis-ci.org/friedelwolff/django-compression-middleware.svg?branch=master\n :target: https://travis-ci.org/friedelwolff/django-compression-middleware\n* .. image:: https://img.shields.io/pypi/djversions/django-compression-middleware.svg\n* .. image:: https://img.shields.io/pypi/pyversions/django-compression-middleware.svg\n* .. image:: https://img.shields.io/pypi/implementation/django-compression-middleware.svg\n\n.. _`documentation`: https://docs.djangoproject.com/en/dev/ref/middleware/#module-django.middleware.gzip\n.. _`WhiteNoise`: https://whitenoise.readthedocs.io/\n.. _`Can I use... Brotli`: http://caniuse.com/#search=brotli\n\nInstallation and usage\n----------------------\n\nThe following requirements are supported and tested in all reasonable\ncombinations:\n\n- Python versions: 2.7, 3.4, 3.5, 3.6, 3.7.\n- Interpreters: CPython and PyPy.\n- Django versions: 1.11 (LTS), 2.0, 2.1.\n\n.. code:: shell\n\n pip install --upgrade django-compression-middleware\n\nTo apply compression to all the views served by Django, add\n``compression_middleware.middleware.CompressionMiddleware`` to the\n``MIDDLEWARE`` setting:\n\n.. code:: python\n\n MIDDLEWARE = [\n # ...\n 'compression_middleware.middleware.CompressionMiddleware',\n # ...\n ]\n\nRemove ``GZipMiddleware`` and ``BrotliMiddleware`` if you used it before.\nConsult the Django documentation on the correct `ordering of middleware`_.\n\n.. _`ordering of middleware`: https://docs.djangoproject.com/en/dev/ref/middleware/#module-django.middleware.gzip\n\nAlternatively you can decorate views individually to serve them with\ncompression:\n\n.. code:: python\n\n from compression_middleware.decorators import compress_page\n\n @compress_page\n def index_view(request):\n ...\n\nNote that your browser might not send the ``br`` entry in the ``Accept-Encoding``\nheader when you test without HTTPS (common on localhost). You can force it to\nsend the header, though. In Firefox, visit ``about:config`` and set\n``network.http.accept-encoding`` to indicate support. Note that you might\nencounter some problems on the web with such a setting (which is why Brotli is\nonly supported on secure connections by default).\n\nCredits and Resources\n---------------------\n\nThe code and tests in this project are based on Django's ``GZipMiddleware`` and\nVa\u0161ek Dohnal's ``django-brotli``. For compression, it uses the following modules\nto bind to fast C modules:\n\n- The `zstandard`_ bindings. It supports both a C module (for CPython) and CFFI\n which should be appropriate for PyPy. See the documentation for full details.\n- The `Brotli`_ bindings or `brotlipy`_. The latter is preferred on PyPy since\n it is implemented using cffi. But both should work on both Python\n implementations.\n- Python's builtin `gzip`_ module.\n\n.. _zstandard: https://pypi.org/project/zstandard/\n.. _Brotli: https://pypi.org/project/Brotli/\n.. _brotlipy: https://pypi.org/project/brotlipy/\n.. _gzip: https://docs.python.org/3/library/gzip.html\n\nFurther readding on Wikipedia:\n\n- `HTTP compression `__\n- `Zstandard `__\n- `Brotli `__\n- `gzip `__\n\nContributing\n------------\n\n1. Clone this repository (``git clone ...``)\n2. Create a virtualenv\n3. Install package dependencies: ``pip install --upgrade -r requirements_dev.txt``\n4. Change some code\n5. Run the tests: in the project root simply execute ``pytest``, and afterwards\n preferably ``tox`` to test the full test matrix. Consider installing as many\n supported interpreters as possible (having them in your ``PATH`` is often\n sufficient).\n6. Submit a pull request and check for any errors reported by the Continuous\n Integration service.\n\nLicense\n-------\n\nThe MPL 2.0 License\n\nCopyright (c) 2019 `Friedel Wolff `_.\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/friedelwolff/django-compression-middleware", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "django-compression-middleware", "package_url": "https://pypi.org/project/django-compression-middleware/", "platform": "", "project_url": "https://pypi.org/project/django-compression-middleware/", "project_urls": { "Homepage": "https://github.com/friedelwolff/django-compression-middleware" }, "release_url": "https://pypi.org/project/django-compression-middleware/0.3.1/", "requires_dist": [ "django", "zstandard", "Brotli" ], "requires_python": "", "summary": "Django middleware to compress responses using several algorithms.", "version": "0.3.1" }, "last_serial": 5270954, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "7543f4faa9c4f57590d12be5217489cc", "sha256": "7fe6c208b5d533c8ef650951aaec7c45a893585467d9065a5f7b5534f47bd333" }, "downloads": -1, "filename": "django_compression_middleware-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "7543f4faa9c4f57590d12be5217489cc", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 7501, "upload_time": "2019-02-02T13:07:10", "url": "https://files.pythonhosted.org/packages/aa/19/236c77946e5cbb19c29c93f947ab7fc72850193d8a4aa567f710cdbcc4bc/django_compression_middleware-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e7a3bcc47f713d87741719f2f074911d", "sha256": "3e0d888d221dc4c62dc9488fbd811ac03192f8b4d4d3e4b9ffb6606c2102fe32" }, "downloads": -1, "filename": "django-compression-middleware-0.1.0.tar.gz", "has_sig": false, "md5_digest": "e7a3bcc47f713d87741719f2f074911d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11465, "upload_time": "2019-02-02T13:07:12", "url": "https://files.pythonhosted.org/packages/f4/21/749aa8b91386dc11d577ce01e33cd98cce93a157491df111edbbcc95583a/django-compression-middleware-0.1.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "70ab0598219fc81b6f7bac769782c2c3", "sha256": "ba6aa6d580861995a1edb3bf319b078e9554e13f53c6da888614c54cb00e0531" }, "downloads": -1, "filename": "django_compression_middleware-0.2.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "70ab0598219fc81b6f7bac769782c2c3", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 7283, "upload_time": "2019-02-08T09:00:03", "url": "https://files.pythonhosted.org/packages/66/ba/8f3a566345c206c00b98e9199c29245255dbc5ec71eadb1a302760d678bb/django_compression_middleware-0.2.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "730761cf5b73013f579e597370916410", "sha256": "6c5e8d57efbaa4bc8a05de527e718eb9ab402df094ca0e10c6ecf1e0d75f409a" }, "downloads": -1, "filename": "django-compression-middleware-0.2.1.tar.gz", "has_sig": false, "md5_digest": "730761cf5b73013f579e597370916410", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17264, "upload_time": "2019-02-08T09:00:05", "url": "https://files.pythonhosted.org/packages/06/87/b8c5d36e312677ea4477d90963809abf21042bbd2e35d50d100dd2bc1946/django-compression-middleware-0.2.1.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "2ef081699e8bca8332ece85baefe06a5", "sha256": "6f57d262a8f210f6f2d1a3a3b60fb10d7512be1f2da11040f85aab79885bc28b" }, "downloads": -1, "filename": "django_compression_middleware-0.3.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "2ef081699e8bca8332ece85baefe06a5", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 8363, "upload_time": "2019-05-11T18:06:51", "url": "https://files.pythonhosted.org/packages/94/3b/32fb6cf3e3853750c5521ae0dcbcc2ac87f6fbc2e0ca54cab5b29c2ffbb3/django_compression_middleware-0.3.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "35eae3375d2986a47a4e2921a38a8b71", "sha256": "c200790e70a73d7ca4cc976c5d8943b34789e82a3f2f2df5f23f01eb3c2edd9d" }, "downloads": -1, "filename": "django-compression-middleware-0.3.0.tar.gz", "has_sig": false, "md5_digest": "35eae3375d2986a47a4e2921a38a8b71", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17845, "upload_time": "2019-05-11T18:06:53", "url": "https://files.pythonhosted.org/packages/f0/88/018775530a219c3c17345b7d4261eec735ed27302251138678a974162548/django-compression-middleware-0.3.0.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "e269ce240ab0983bfa36bfe7521d0e43", "sha256": "3866f282574bbdf37d018509c8a24028a27c3966b61d98f87f6d5eba602f9a42" }, "downloads": -1, "filename": "django_compression_middleware-0.3.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "e269ce240ab0983bfa36bfe7521d0e43", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 8376, "upload_time": "2019-05-15T07:00:32", "url": "https://files.pythonhosted.org/packages/58/33/a7006a07bd9624f579c867e8c16bfd29d0763b0c9cb30cfa3980af86080e/django_compression_middleware-0.3.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "22dc8bea5983281f2ee5dce2be5fc4fe", "sha256": "6061d476e2601e5ffd08d542c55789ce6b2bd8b9aab080d993a06d841cdaf98e" }, "downloads": -1, "filename": "django-compression-middleware-0.3.1.tar.gz", "has_sig": false, "md5_digest": "22dc8bea5983281f2ee5dce2be5fc4fe", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17876, "upload_time": "2019-05-15T07:00:34", "url": "https://files.pythonhosted.org/packages/ce/b9/c96d79493a2271c7fd4c2eef43e899fb61cc85b36d98aef4af237f6f44cc/django-compression-middleware-0.3.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "e269ce240ab0983bfa36bfe7521d0e43", "sha256": "3866f282574bbdf37d018509c8a24028a27c3966b61d98f87f6d5eba602f9a42" }, "downloads": -1, "filename": "django_compression_middleware-0.3.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "e269ce240ab0983bfa36bfe7521d0e43", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 8376, "upload_time": "2019-05-15T07:00:32", "url": "https://files.pythonhosted.org/packages/58/33/a7006a07bd9624f579c867e8c16bfd29d0763b0c9cb30cfa3980af86080e/django_compression_middleware-0.3.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "22dc8bea5983281f2ee5dce2be5fc4fe", "sha256": "6061d476e2601e5ffd08d542c55789ce6b2bd8b9aab080d993a06d841cdaf98e" }, "downloads": -1, "filename": "django-compression-middleware-0.3.1.tar.gz", "has_sig": false, "md5_digest": "22dc8bea5983281f2ee5dce2be5fc4fe", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17876, "upload_time": "2019-05-15T07:00:34", "url": "https://files.pythonhosted.org/packages/ce/b9/c96d79493a2271c7fd4c2eef43e899fb61cc85b36d98aef4af237f6f44cc/django-compression-middleware-0.3.1.tar.gz" } ] }