Files
pocket-id/backend/internal/utils/http_util.go
2026-07-10 16:31:45 -05:00

13 lines
363 B
Go

package utils
import (
"strconv"
"time"
)
func CacheControlValue(maxAge, staleWhileRevalidate time.Duration) string {
maxAgeSeconds := strconv.Itoa(int(maxAge.Seconds()))
staleWhileRevalidateSeconds := strconv.Itoa(int(staleWhileRevalidate.Seconds()))
return "public, max-age=" + maxAgeSeconds + ", stale-while-revalidate=" + staleWhileRevalidateSeconds
}