Skip to content

Set Cache-Control: no-cache for redirects to badges #1653

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 14, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions readthedocs/projects/views/public.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from django.http import HttpResponse, HttpResponseRedirect, Http404
from django.shortcuts import get_object_or_404, render_to_response
from django.template import RequestContext
from django.views.decorators.cache import cache_control
from django.views.generic import ListView, DetailView
from django.utils.datastructures import SortedDict
from django.views.decorators.cache import cache_page
Expand Down Expand Up @@ -118,8 +119,7 @@ def _badge_return(redirect, url):
return http_response


# TODO remove this, it's a temporary fix to heavy database usage
@cache_page(60 * 30)
@cache_control(no_cache=True)
def project_badge(request, project_slug, redirect=True):
"""Return a sweet badge for the project"""
version_slug = request.GET.get('version', LATEST)
Expand Down