mirror of
https://github.com/pocket-id/pocket-id.git
synced 2026-07-18 16:59:53 +00:00
13 lines
363 B
Go
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
|
|
}
|