# HttpBuildCache

abstract class HttpBuildCache : AbstractBuildCache(source)

Configuration object for the HTTP build cache. Cache entries are loaded via GET and stored via PUT requests.

A successful GET request must return a response with status 200 (cache hit) or 404 (cache miss), with cache hit responses including the cache entry as the response body. A successful PUT request must return any 2xx response.

PUT requests may also return a 413 Payload Too Large response to indicate that the payload is larger than can be accepted. This is useful when isUseExpectContinue is enabled.

Redirecting responses may be issued with 301, 302, 303, 307 or 308 responses. Redirecting responses to PUT requests must use 307 or 308 to have the PUT replayed. Otherwise, the redirect will be followed with a GET request.

Any other type of response will be treated as an error, causing the remote cache to be disabled for the remainder of the build.

When credentials are configured (see getCredentials), they are sent using HTTP Basic Auth.

Requests that fail during request transmission, after having established a TCP connection, will automatically be retried. This includes dropped connections, read or write timeouts, and low level network failures such as a connection resets.

#### Since

3.5

## Constructors

HttpBuildCache
Link copied to clipboard
constructor()

## Properties

credentials
Link copied to clipboard
val credentials: HttpBuildCacheCredentials
url
Link copied to clipboard
@get: Nullable
open var url: URI

## Functions

credentials
Link copied to clipboard
open fun credentials(configuration: Action<in HttpBuildCacheCredentials>)
Configures the credentials used to access the HTTP cache backend.
isAllowInsecureProtocol
Link copied to clipboard
open fun isAllowInsecureProtocol(): Boolean
Specifies whether it is acceptable to communicate with a build cache over an insecure HTTP connection.
isAllowUntrustedServer
Link copied to clipboard
open fun isAllowUntrustedServer(): Boolean
Specifies whether it is acceptable to communicate with an HTTP build cache backend with an untrusted SSL certificate.
isEnabled
Link copied to clipboard
open fun isEnabled(): Boolean
isPush
Link copied to clipboard
open fun isPush(): Boolean
isUseExpectContinue
Link copied to clipboard
open fun isUseExpectContinue(): Boolean
Specifies whether HTTP expect-continue should be used for store requests.
setAllowInsecureProtocol
Link copied to clipboard
open fun setAllowInsecureProtocol(allowInsecureProtocol: Boolean)
Specifies whether it is acceptable to communicate with a build cache over an insecure HTTP connection.
setAllowUntrustedServer
Link copied to clipboard
open fun setAllowUntrustedServer(allowUntrustedServer: Boolean)
Specifies whether it is acceptable to communicate with an HTTP build cache backend with an untrusted SSL certificate.
setEnabled
Link copied to clipboard
open fun setEnabled(enabled: Boolean)
setPush
Link copied to clipboard
open fun setPush(push: Boolean)
setUrl
Link copied to clipboard
open fun setUrl(url: String)
open fun setUrl(url: URL)
Sets the URL of the cache.
setUseExpectContinue
Link copied to clipboard
open fun setUseExpectContinue(useExpectContinue: Boolean)
Specifies whether HTTP expect-continue should be used for store requests.