Save tiles to the database to make empty tile load faster

This commit is contained in:
Eli Ribble 2026-03-11 17:01:47 +00:00
parent a1e6f930cb
commit 3ccc05d4c5
No known key found for this signature in database
10 changed files with 559 additions and 98 deletions

View file

@ -98,10 +98,10 @@ func writeImage(ctx context.Context, w http.ResponseWriter, org *models.Organiza
if err != nil {
return fmt.Errorf("image at point: %w", err)
}
log.Info().Int("size", len(img)).Msg("image")
log.Info().Int("size", len(img.Content)).Msg("image")
w.Header().Set("Content-Type", "image/png")
w.Header().Set("Content-Length", fmt.Sprintf("%d", len(img)))
_, err = io.Copy(w, bytes.NewBuffer(img))
w.Header().Set("Content-Length", fmt.Sprintf("%d", len(img.Content)))
_, err = io.Copy(w, bytes.NewBuffer(img.Content))
if err != nil {
return fmt.Errorf("copy bytes: %w", err)
}