mirror of
https://git.linux-kernel.at/oliver/ivatar.git
synced 2025-11-11 18:56:23 +00:00
Compare commits
1 Commits
87f4e45afa
...
devel
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cdc89c4394 |
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user