forked from the-distro/infra
feat(s3-revproxy): tune the cache-control
Adopt the original values from the Perl script. Signed-off-by: Raito Bezarius <masterancpp@gmail.com>
This commit is contained in:
parent
c38e9b482f
commit
8073ae6942
|
@ -122,6 +122,16 @@ in
|
|||
allowMethods = [ "GET" ];
|
||||
allowOrigins = [ "*" ];
|
||||
};
|
||||
|
||||
cache = {
|
||||
noCacheEnabled = false;
|
||||
# Taken from the original Perl script.
|
||||
# maxage=600: Serve from cache for 5 minutes.
|
||||
# stale-while-revaliadate=1800: Serve from cache while updating in the background for 30 minutes.
|
||||
# https://web.dev/stale-while-revalidate/
|
||||
# https://developer.fastly.com/learning/concepts/cache-freshness/
|
||||
cacheControl = "maxage=600,stale-while-revalidate=1800,public";
|
||||
};
|
||||
};
|
||||
targets = mapAttrs (name: bucket: mkTarget { inherit name bucket; }) cfg.targets;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue