{"id":15911332,"url":"https://github.com/laactech/django-response-compression","last_synced_at":"2025-04-03T02:14:39.706Z","repository":{"id":233736985,"uuid":"332818725","full_name":"laactech/django-response-compression","owner":"laactech","description":"Combined Brotli and GZip compression for Django HTTP responses","archived":false,"fork":false,"pushed_at":"2021-01-25T17:39:52.000Z","size":20,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-08T16:17:00.349Z","etag":null,"topics":["brotli","compression","django","gzip","http"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/laactech.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2021-01-25T16:58:10.000Z","updated_at":"2021-01-25T17:42:08.000Z","dependencies_parsed_at":"2024-04-17T08:41:59.009Z","dependency_job_id":"92bf63f7-1644-434b-b7bf-1222ca8d3006","html_url":"https://github.com/laactech/django-response-compression","commit_stats":null,"previous_names":["laactech/django-response-compression"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/laactech%2Fdjango-response-compression","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/laactech%2Fdjango-response-compression/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/laactech%2Fdjango-response-compression/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/laactech%2Fdjango-response-compression/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/laactech","download_url":"https://codeload.github.com/laactech/django-response-compression/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246922246,"owners_count":20855345,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["brotli","compression","django","gzip","http"],"created_at":"2024-10-06T15:41:20.414Z","updated_at":"2025-04-03T02:14:39.683Z","avatar_url":"https://github.com/laactech.png","language":"Python","readme":"# Django Response Compression\n\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/python/black)\n[![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://github.com/laactech/django-require-login/blob/master/LICENSE.md)\n\nCombined Brotli and GZip compression for Django HTTP responses\n\nThis middleware copies Django's GZipMiddleware but adds Brotli compression. Brotli is\n[supported](https://caniuse.com/?search=brotli) by most major browsers. If the request does not allow Brotli encoding,\nthe middleware falls back to Django's GZipMiddleware. Read Django's GZipMiddleware\n[documentation](https://docs.djangoproject.com/en/dev/ref/middleware/#module-django.middleware.gzip) to understand how\nthis middleware works and heed the warnings.\n\n## Supported Versions\n\n* Python 3.6, 3.7, 3.8, 3.9\n* Django 2.2, 3.0, 3.1\n\n## Installation and Setup\n\nInstall via pip.\n\n```sh\npip install django-response-compression\n```\n\nAdd the `ResponseCompressionMiddleware` to your Django middleware:\n\n```python\nMIDDLEWARE = [\n    # ...\n    'response_compression.middleware.ResponseCompressionMiddleware',\n    # ...\n]\n```\n\nRemove Django's GZipMiddleware if you added it.\n\n**Read the GZipMiddleware [documentation](https://docs.djangoproject.com/en/dev/ref/middleware/#module-django.middleware.gzip)\nfor notes about middleware ordering**\n\nIf you want to compress specific responses, use the decorator on your views.\n\n```python\nfrom response_compression.decorators import compress_response\n\n\n@compress_response\ndef my_view(request):\n    ...\n```\n\nBoth the middleware and decorator are compatible with Django REST Framework responses.\n\nThe default brotli compression level is 4, and you can customize the brotli compression level by adding this to\ndjango's settings:\n\n```python\nRESPONSE_COMPRESSION_BROTLI_LEVEL = 5\n```\n\n\n## Security\n\nIf you believe you've found a bug with security implications, please do not disclose this\nissue in a public forum.\n\nEmail us at [support@laac.dev](mailto:support@laac.dev)\n\n## Contribute\n\nSee [CONTRIBUTING.md](https://github.com/laactech/django-response-compression/blob/master/CONTRIBUTING.md)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flaactech%2Fdjango-response-compression","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flaactech%2Fdjango-response-compression","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flaactech%2Fdjango-response-compression/lists"}