diff --git a/apiserver/plane/api/views/cycle.py b/apiserver/plane/api/views/cycle.py index 6b5cb2e4c..f8e8715e1 100644 --- a/apiserver/plane/api/views/cycle.py +++ b/apiserver/plane/api/views/cycle.py @@ -6,6 +6,8 @@ from django.db import IntegrityError from django.db.models import OuterRef, Func, F, Q, Exists, OuterRef, Count, Prefetch from django.core import serializers from django.utils import timezone +from django.utils.decorators import method_decorator +from django.views.decorators.gzip import gzip_page # Third party imports from rest_framework.response import Response @@ -169,6 +171,7 @@ class CycleIssueViewSet(BaseViewSet): .distinct() ) + @method_decorator(gzip_page) def list(self, request, slug, project_id, cycle_id): try: order_by = request.GET.get("order_by", "created_at") diff --git a/apiserver/plane/api/views/issue.py b/apiserver/plane/api/views/issue.py index d609d2678..165b3e373 100644 --- a/apiserver/plane/api/views/issue.py +++ b/apiserver/plane/api/views/issue.py @@ -6,7 +6,8 @@ from itertools import groupby, chain # Django imports from django.db.models import Prefetch, OuterRef, Func, F, Q from django.core.serializers.json import DjangoJSONEncoder - +from django.utils.decorators import method_decorator +from django.views.decorators.gzip import gzip_page # Third Party imports from rest_framework.response import Response @@ -139,6 +140,7 @@ class IssueViewSet(BaseViewSet): .prefetch_related("labels") ) + @method_decorator(gzip_page) def list(self, request, slug, project_id): try: filters = issue_filters(request.query_params, "GET") @@ -218,6 +220,7 @@ class IssueViewSet(BaseViewSet): class UserWorkSpaceIssues(BaseAPIView): + @method_decorator(gzip_page) def get(self, request, slug): try: issues = ( @@ -251,6 +254,7 @@ class WorkSpaceIssuesEndpoint(BaseAPIView): WorkSpaceAdminPermission, ] + @method_decorator(gzip_page) def get(self, request, slug): try: issues = ( @@ -273,6 +277,7 @@ class IssueActivityEndpoint(BaseAPIView): ProjectEntityPermission, ] + @method_decorator(gzip_page) def get(self, request, slug, project_id, issue_id): try: issue_activities = ( @@ -554,6 +559,7 @@ class SubIssuesEndpoint(BaseAPIView): ProjectEntityPermission, ] + @method_decorator(gzip_page) def get(self, request, slug, project_id, issue_id): try: sub_issues = ( diff --git a/apiserver/plane/api/views/module.py b/apiserver/plane/api/views/module.py index 207381072..f1d29db2c 100644 --- a/apiserver/plane/api/views/module.py +++ b/apiserver/plane/api/views/module.py @@ -5,6 +5,8 @@ import json from django.db import IntegrityError from django.db.models import Prefetch, F, OuterRef, Func, Exists, Count, Q from django.core import serializers +from django.utils.decorators import method_decorator +from django.views.decorators.gzip import gzip_page # Third party imports from rest_framework.response import Response @@ -177,6 +179,7 @@ class ModuleIssueViewSet(BaseViewSet): .distinct() ) + @method_decorator(gzip_page) def list(self, request, slug, project_id, module_id): try: order_by = request.GET.get("order_by", "created_at") diff --git a/apiserver/plane/settings/common.py b/apiserver/plane/settings/common.py index 9d270662e..73c3c4be5 100644 --- a/apiserver/plane/settings/common.py +++ b/apiserver/plane/settings/common.py @@ -48,6 +48,7 @@ MIDDLEWARE = [ "django.contrib.auth.middleware.AuthenticationMiddleware", "django.middleware.clickjacking.XFrameOptionsMiddleware", "crum.CurrentRequestUserMiddleware", + "django.middleware.gzip.GZipMiddleware", ] REST_FRAMEWORK = {