Spaces:
Running on Zero
Running on Zero
Commit ·
a50f869
1
Parent(s): a05d92b
Increase signed URL expiration to 24 hours for better caching
Browse files- app/r2_config.py +5 -1
app/r2_config.py
CHANGED
|
@@ -41,7 +41,11 @@ R2_QAIDA_AUDIO_FOLDER = "qaida_audio"
|
|
| 41 |
R2_NIMAZ_AUDIO_FOLDER = "Nimaz_Mutarjam_audio"
|
| 42 |
|
| 43 |
# Signed URL expiration (in seconds)
|
| 44 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 45 |
|
| 46 |
|
| 47 |
def generate_signed_url(object_key: str, expiration: int = SIGNED_URL_EXPIRATION) -> str:
|
|
|
|
| 41 |
R2_NIMAZ_AUDIO_FOLDER = "Nimaz_Mutarjam_audio"
|
| 42 |
|
| 43 |
# Signed URL expiration (in seconds)
|
| 44 |
+
# 3600 = 1 hour (default)
|
| 45 |
+
# 86400 = 24 hours
|
| 46 |
+
# 604800 = 7 days
|
| 47 |
+
# 2592000 = 30 days (maximum recommended)
|
| 48 |
+
SIGNED_URL_EXPIRATION = 86400 # 24 hours - good balance of security and performance
|
| 49 |
|
| 50 |
|
| 51 |
def generate_signed_url(object_key: str, expiration: int = SIGNED_URL_EXPIRATION) -> str:
|