Do "max-age" with a positive value and "no-cache" make sense? The documentation doesn't mention whether they are mutually exclusive https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control
However org.springframework.http.CacheControl doesn't allow me to create an instance of it which would contain both of them. It has an interface that allows you to create an instance of CacheControl that would have either "max-age" or "no-cache".
public static CacheControl noCache() {
CacheControl cc = new CacheControl();
cc.noCache = true;
return cc;
}
public static CacheControl maxAge(Duration maxAge) {
CacheControl cc = new CacheControl();
cc.maxAge = maxAge;
return cc;
}
There is no no-static method for adding "no-cache" or "max-age" after instance creation. Is it on purpose and correct?