frigate
frigate copied to clipboard
[Bug]: /camera_name/label/snapshot.jpg has incorrect cache max-age
Describe the problem you are having
I expect /camera_name/label/snapshot.jpg to give me the latest snapshot of the specified label.
If the event is ongoing, it returns a snapshot with Cache-Control=no-store. If the event is complete, it returns a snapshot with Cache-Control=private, max-age=31536000
If there is a new event, /camera_name/label/snapshot.jpg still returns the old event snapshot because of the cache setting.
Related endpoint /camera_name/label/thumbnail.jpg always returns max-age=60.
Potential fix 1: make both of the above always return Cache-Control=no-store Potential fix 2: make snapshot.jpg to return max-age=60 if the event is complete, matching the current thumbnail behavior: pull request #9812
Version
latest commit b9e20fc
Frigate config file
-
Relevant log output
-
FFprobe output from your camera
-
Frigate stats
No response
Operating system
Debian
Install method
Docker Compose
Coral version
CPU (no coral)
Network connection
Wired
Camera make and model
Any other information that may be helpful
No response
It seems like you're looking at the wrong function. The label based snapshot doesn't have cache control https://github.com/blakeblackshear/frigate/blob/dev/frigate%2Fhttp.py#L1051
Actually, I see what you're saying about when the event is ended only
it does.
@bp.route("/<camera_name>/<label>/snapshot.jpg")
def label_snapshot(camera_name, label):
...
return event_snapshot(event.id)
event_snapshot() has the Cache-Control behavior in origin post
edit: saw your comment as I was writing this
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.