feat(background): add Last-Modified header #1376

Merged
konrad merged 1 commits from :last-modified into main 2023-01-29 22:07:47 +00:00
First-time contributor

Add Last-Modified header to background responses so clients can cache the images.

Test Plan:
After this change, open a bunch of different lists with backgrounds and check that the images are being loaded from cache and that Last-Modified header is present (see screenshot).

Add Last-Modified header to background responses so clients can cache the images. Test Plan: After this change, open a bunch of different lists with backgrounds and check that the images are being loaded from cache and that Last-Modified header is present (see screenshot).
konrad requested changes 2023-01-29 14:36:00 +00:00
@ -306,6 +306,11 @@ func GetListBackground(c echo.Context) error {
return handler.HandleHTTPError(err, c)
}
stat, err := bgFile.File.Stat()
Owner

Please handle the error - at least log it if it is not critical.

Please handle the error - at least log it if it is not critical.
Ghost marked this conversation as resolved
Owner

Seems to work great otherwise!

Seems to work great otherwise!
Ghost force-pushed last-modified from ba622745ce to 584b436c0e 2023-01-29 20:07:45 +00:00 Compare
Ghost requested review from konrad 2023-01-29 20:08:34 +00:00
konrad requested changes 2023-01-29 21:20:49 +00:00
konrad left a comment
Owner
Please fix the lint: https://drone.kolaente.de/vikunja/api/4655/1/11
Author
First-time contributor

What's wrong with that lint though? Doesn't seem like anything related to the file this commit is changing

What's wrong with that lint though? Doesn't seem like anything related to the file this commit is changing
Ghost requested review from konrad 2023-01-29 21:40:51 +00:00
Owner

whoops looks like this is broken in main right now. I've just fixed it, please rebase.

whoops looks like this is broken in main right now. I've just fixed it, please rebase.
Ghost force-pushed last-modified from 584b436c0e to 6d63e4525c 2023-01-29 21:53:00 +00:00 Compare
Owner

Still wip?

Still wip?
Ghost changed title from WIP: feat(background): add Last-Modified header to feat(background): add Last-Modified header 2023-01-29 21:57:19 +00:00
konrad scheduled this pull request to auto merge when all checks succeed 2023-01-29 21:59:28 +00:00
konrad approved these changes 2023-01-29 21:59:39 +00:00
konrad left a comment
Owner

Thanks!

Thanks!
konrad merged commit f660badc3d into main 2023-01-29 22:07:47 +00:00
Ghost deleted branch last-modified 2023-01-29 22:17:29 +00:00
Sign in to join this conversation.
No reviewers
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: vikunja/vikunja#1376
No description provided.