diff --git a/config.py b/config.py index fbd0e1d..5c16ca4 100644 --- a/config.py +++ b/config.py @@ -244,10 +244,6 @@ CACHES = { }, } -# This is 5 minutes caching for generated/resized images, -# so the sites don't hit ivatar so much - it's what's set in the HTTP header -CACHE_IMAGES_MAX_AGE = 5 * 60 - CACHE_RESPONSE = True # Trusted URLs for default redirection diff --git a/ivatar/views.py b/ivatar/views.py index fcd115a..c8f0793 100644 --- a/ivatar/views.py +++ b/ivatar/views.py @@ -31,7 +31,6 @@ from .pagan_optimized import create_optimized_pagan from ivatar.settings import AVATAR_MAX_SIZE, JPEG_QUALITY, DEFAULT_AVATAR_SIZE from ivatar.settings import CACHE_RESPONSE -from ivatar.settings import CACHE_IMAGES_MAX_AGE from ivatar.settings import TRUSTED_DEFAULT_URLS from ivatar.settings import ( DEFAULT_GRAVATARPROXY, @@ -335,7 +334,6 @@ class AvatarImageView(TemplateView): ) response = CachingHttpResponse(uri, data, content_type=f"image/{imgformat}") - response["Cache-Control"] = "max-age=%i" % CACHE_IMAGES_MAX_AGE # Remove Vary header for images since language doesn't matter response["Vary"] = "" return response @@ -355,7 +353,6 @@ class AvatarImageView(TemplateView): def _return_cached_response(self, data, uri): data.seek(0) response = CachingHttpResponse(uri, data, content_type="image/png") - response["Cache-Control"] = "max-age=%i" % CACHE_IMAGES_MAX_AGE # Remove Vary header for images since language doesn't matter response["Vary"] = "" return response @@ -461,7 +458,6 @@ class GravatarProxyView(View): response = HttpResponse( data.read(), content_type=f"image/{file_format(img.format)}" ) - response["Cache-Control"] = "max-age=%i" % CACHE_IMAGES_MAX_AGE # Remove Vary header for images since language doesn't matter response["Vary"] = "" return response @@ -590,7 +586,6 @@ class BlueskyProxyView(View): response = HttpResponse( data.read(), content_type=f"image/{file_format(format)}" ) - response["Cache-Control"] = "max-age=%i" % CACHE_IMAGES_MAX_AGE # Remove Vary header for images since language doesn't matter response["Vary"] = "" return response