Skip to main content

Middleware that compresses response using brotli algorithm.

Project description

PyPi MIT TravisCI Coverage Updates Supported Python implementations Supported Python versions

Introduction

This project consists of BrotliMiddleware which works the same as Django GZipMiddleware (Docs/Source). BrotliMiddleware will compress content of HTTP response using brotli algorithm (Brotli Compressed Data Format is defined in RFC 7932).

In November 2016 is brotli supported by Firefox, Chrome, Android Browser and Opera (detailed stats on caniuse). Brotli is applied only when client has sent Accept-Encoding header containing br.

Installation

This software is in alpha version and should not be used in production.

  • Supported Python versions are: 3.5, 3.6 and 3.7.

  • Supported Django versions are: 1.11.x (LTS), 2.0.x and 2.1.x (LTS).

pip install --upgrade django-brotli

Add django_brotli.middleware.BrotliMiddleware to MIDDLEWARE:

MIDDLEWARE = [
    'django_brotli.middleware.BrotliMiddleware',
    # ...
]

Credits and Resources

Contributing

  1. Clone this repository (git clone ...)

  2. Create virtualenv

  3. Install package dependencies: pip install --upgrade -r requirements.txt

  4. Change some code

  5. Run tests: in project root simply execute pytest

  6. Submit PR :)

License

The MIT License (MIT)

Copyright (c) 2016–2019 Vašek Dohnal (@illagrenan)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-brotli-0.2.1.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

django_brotli-0.2.1-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file django-brotli-0.2.1.tar.gz.

File metadata

  • Download URL: django-brotli-0.2.1.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.1

File hashes

Hashes for django-brotli-0.2.1.tar.gz
Algorithm Hash digest
SHA256 7e99d774ddb48aabdb1d209d601a46226260f0030a59e551a0a0d39f8e79f6aa
MD5 e43e6f25ce4d6dde45b90ea182e7ea56
BLAKE2b-256 ed0ba4193a29fd97a5c023f605e42f16272bd27fcaa3f7e471f405b5f6dfffd0

See more details on using hashes here.

File details

Details for the file django_brotli-0.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for django_brotli-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5f990fabc14ca2b1f18e741014df4f35a845a6fef0c493454db5f62faba8d276
MD5 38b9eb745fc3310e95de780b8f086f88
BLAKE2b-256 b3e9d83377ee79d63112b074fb3da5d394001848ef0ca4b24c7eea37b3457d82

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page