2 Commits

Author SHA1 Message Date
Oliver Falk
f58841d538 Merge branch 'devel' into 'master'
🚀 Major Release: ivatar 2.0 - Performance, Security, and Instrumentation Overhaul

Closes #106, #104, and #102

See merge request oliver/ivatar!281
2025-11-03 10:00:39 +01:00
Oliver Falk
cdc89c4394 Remove cache control from the application, because we handel this at the frontend 2025-11-03 09:57:24 +01:00
2 changed files with 0 additions and 9 deletions

View File

@@ -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

View File

@@ -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