Skip to content

Commit

Permalink
cmd/stickers: be more clever
Browse files Browse the repository at this point in the history
Signed-off-by: Xe Iaso <[email protected]>
  • Loading branch information
Xe committed Jan 11, 2025
1 parent e0a7453 commit c2187ae
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions cmd/stickers/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,9 @@ func main() {
return
}

w.Header().Add("Cache-Control", "max-age=3599")
w.Header().Add("Expires", time.Now().Add(time.Hour-time.Second).Format(http.TimeFormat))

http.Redirect(w, r, req.URL, http.StatusTemporaryRedirect)
})

Expand Down
4 changes: 2 additions & 2 deletions cmd/uploud/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import (
"github.com/gen2brain/webp"
"golang.org/x/sync/errgroup"
"within.website/x/internal"
"within.website/x/tigris"
)

var (
Expand Down Expand Up @@ -135,8 +134,9 @@ func main() {
ContentLength: aws.Int64(st.Size()),
ChecksumSHA256: aws.String(shaSum),
ContentMD5: aws.String(md5Sum),
CacheControl: aws.String("max-age=2592000,public"),
},
tigris.WithCreateObjectIfNotExists(),
//tigris.WithCreateObjectIfNotExists(),
)
if err != nil {
log.Fatal(err)
Expand Down

0 comments on commit c2187ae

Please sign in to comment.