mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-12 14:15:22 +03:00
improve caching
This commit is contained in:
parent
d275d7217e
commit
550fce3250
@ -131,6 +131,8 @@ http {
|
||||
image/jpeg jpg;
|
||||
}
|
||||
|
||||
expires 7d;
|
||||
add_header Cache-Control "public";
|
||||
autoindex on;
|
||||
root /media/frigate;
|
||||
}
|
||||
|
||||
@ -1232,7 +1232,7 @@ def preview_gif(camera_name: str, start_ts, end_ts, max_cache_age=2592000):
|
||||
|
||||
@MediaBp.route("/<camera_name>/start/<int:start_ts>/end/<int:end_ts>/preview.mp4")
|
||||
@MediaBp.route("/<camera_name>/start/<float:start_ts>/end/<float:end_ts>/preview.mp4")
|
||||
def preview_mp4(camera_name: str, start_ts, end_ts, max_cache_age=2592000):
|
||||
def preview_mp4(camera_name: str, start_ts, end_ts, max_cache_age=604800):
|
||||
file_name = f"preview_{camera_name}_{start_ts}-{end_ts}.mp4"
|
||||
|
||||
if len(file_name) > 1000:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user