Skip to content

Commit

Permalink
Merge pull request #3323 from ttys0dev/cache-feeds
Browse files Browse the repository at this point in the history
Cache feeds for 60 seconds instead of rate limiting
  • Loading branch information
mlissner authored Oct 31, 2023
2 parents 718a7ba + 292b514 commit b9e6134
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions cl/opinion_page/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from django.template.response import TemplateResponse
from django.urls import reverse
from django.utils.timezone import now
from django.views.decorators.cache import never_cache
from django.views.decorators.cache import cache_page, never_cache
from django.views.decorators.csrf import csrf_exempt, ensure_csrf_cookie
from reporters_db import (
EDITIONS,
Expand All @@ -39,7 +39,6 @@
from cl.lib.http import is_ajax
from cl.lib.model_helpers import choices_to_csv
from cl.lib.models import THUMBNAIL_STATUSES
from cl.lib.ratelimiter import ratelimiter_all_2_per_m
from cl.lib.search_utils import (
get_citing_clusters_with_cache,
get_related_clusters_with_cache,
Expand Down Expand Up @@ -242,7 +241,7 @@ def view_docket(request: HttpRequest, pk: int, slug: str) -> HttpResponse:
return TemplateResponse(request, "docket.html", context)


@ratelimiter_all_2_per_m
@cache_page(60)
def view_docket_feed(request: HttpRequest, docket_id: int) -> HttpResponse:
return DocketFeed()(request, docket_id=docket_id)

Expand Down

0 comments on commit b9e6134

Please sign in to comment.