# Uses of Class
org.springframework.http.CacheControl

Packages that use CacheControl
Package
Description
org.springframework.http
Contains a basic abstraction over client/server-side HTTP.

## Uses of CacheControl in org.springframework.http

Methods in org.springframework.http that return CacheControl
Modifier and Type
Method
Description
`CacheControl`
CacheControl.`cachePrivate()`
Add a "private" directive.
`CacheControl`
CacheControl.`cachePublic()`
Add a "public" directive.
`static CacheControl`
CacheControl.`empty()`
Return an empty directive.
`CacheControl`
CacheControl.`immutable()`
Add an "immutable" directive.
`static CacheControl`
CacheControl.`maxAge(long maxAge, TimeUnit unit)`
Add a "max-age=" directive.
`static CacheControl`
CacheControl.`maxAge(Duration maxAge)`
Add a "max-age=" directive.
`CacheControl`
CacheControl.`mustRevalidate()`
Add a "must-revalidate" directive.
`static CacheControl`
CacheControl.`noCache()`
Add a "no-cache" directive.
`static CacheControl`
CacheControl.`noStore()`
Add a "no-store" directive.
`CacheControl`
CacheControl.`noTransform()`
Add a "no-transform" directive.
`CacheControl`
CacheControl.`proxyRevalidate()`
Add a "proxy-revalidate" directive.
`CacheControl`
CacheControl.`sMaxAge(long sMaxAge, TimeUnit unit)`
Add an "s-maxage" directive.
`CacheControl`
CacheControl.`sMaxAge(Duration sMaxAge)`
Add an "s-maxage" directive.
`CacheControl`
CacheControl.`staleIfError(long staleIfError, TimeUnit unit)`
Add a "stale-if-error" directive.
`CacheControl`
CacheControl.`staleIfError(Duration staleIfError)`
Add a "stale-if-error" directive.
`CacheControl`
CacheControl.`staleWhileRevalidate(long staleWhileRevalidate, TimeUnit unit)`
Add a "stale-while-revalidate" directive.
`CacheControl`
CacheControl.`staleWhileRevalidate(Duration staleWhileRevalidate)`
Add a "stale-while-revalidate" directive.
Methods in org.springframework.http with parameters of type CacheControl
Modifier and Type
Method
Description
`B`
ResponseEntity.HeadersBuilder.`cacheControl(CacheControl cacheControl)`
Set the caching directives for the resource, as specified by the HTTP 1.1 `Cache-Control` header.
`void`
HttpHeaders.`setCacheControl(CacheControl cacheControl)`
Set a configured `CacheControl` instance as the new value of the `Cache-Control` header.