mirror of
https://github.com/umap-project/umap.git
synced 2025-04-29 11:52:38 +02:00
chore: always gzip geojson in S3 storage
This commit is contained in:
parent
1ac9a06195
commit
14e74d15c1
2 changed files with 14 additions and 0 deletions
|
@ -182,6 +182,18 @@ STORAGES = {
|
||||||
"BACKEND": "umap.storage.UmapManifestStaticFilesStorage",
|
"BACKEND": "umap.storage.UmapManifestStaticFilesStorage",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
# Add application/json and application/geo+json to default django-storages setting
|
||||||
|
# in order to gzip our datalayers geojson files.
|
||||||
|
GZIP_CONTENT_TYPES = [
|
||||||
|
"text/css",
|
||||||
|
"text/javascript",
|
||||||
|
"application/javascript",
|
||||||
|
"application/x-javascript",
|
||||||
|
"image/svg+xml",
|
||||||
|
"application/json",
|
||||||
|
"application/geo+json",
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
# =============================================================================
|
# =============================================================================
|
||||||
# Templates
|
# Templates
|
||||||
|
|
|
@ -72,6 +72,8 @@ class UmapManifestStaticFilesStorage(ManifestStaticFilesStorage):
|
||||||
|
|
||||||
|
|
||||||
class UmapS3(S3Storage):
|
class UmapS3(S3Storage):
|
||||||
|
gzip = True
|
||||||
|
|
||||||
def get_reference_version(self, instance):
|
def get_reference_version(self, instance):
|
||||||
metadata = self.connection.meta.client.head_object(
|
metadata = self.connection.meta.client.head_object(
|
||||||
Bucket=self.bucket_name, Key=instance.geojson.name
|
Bucket=self.bucket_name, Key=instance.geojson.name
|
||||||
|
|
Loading…
Reference in a new issue