Remove the "is behind cache" functionality

We're always behind cache now (we may or may not be cached, but that's
not what this check was about)
This commit is contained in:
Magnus Hagander
2016-05-21 13:15:40 -04:00
parent fd904ebc27
commit 9bcaa6ab33
4 changed files with 2 additions and 35 deletions

View File

@ -13,28 +13,6 @@ def send_template_mail(sender, receiver, subject, templatename, templateattr={},
template_to_string(templatename, templateattr),
usergenerated=usergenerated)
def is_behind_cache(request):
"""
Determine if the client is behind a cache. In this, we are only interested in our own
frontend caches, we don't care about any client side caches or such things.
"""
if request.is_secure():
# We never proxy https requests, so shortcut the check if it's there
return False
if request.META.has_key('HTTP_X_VARNISH'):
# So, it's a varnish cache. Check that it's one of our frontends
if request.META['REMOTE_ADDR'] in settings.FRONTEND_SERVERS:
# Yup, it's one of our varnish servers, so we're behind a cache
return True
else:
# It's someone elses varnish? Or misconfigured? Either way, don't claim
# it's behind a cache.
return False
# X-Varnish not set, clearly we're not behind a cache
return False
def get_client_ip(request):
"""
Get the IP of the client. If the client is served through our Varnish caches,