# 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 getUseExpectContinue 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

## Functions

credentials
Link copied to clipboard
open fun credentials(configuration: Action<in HttpBuildCacheCredentials>)
Configures the credentials used to access the HTTP cache backend.
getAllowInsecureProtocol
Link copied to clipboard
abstract fun getAllowInsecureProtocol(): Property<Boolean>
Specifies whether it is acceptable to communicate with a build cache over an insecure HTTP connection.
getAllowUntrustedServer
Link copied to clipboard
abstract fun getAllowUntrustedServer(): Property<Boolean>
Specifies whether it is acceptable to communicate with an HTTP build cache backend with an untrusted SSL certificate.
getEnabled
Link copied to clipboard
abstract fun getEnabled(): Property<Boolean>
Controls whether the build cache is enabled.
getIsAllowInsecureProtocol
Link copied to clipboard
open fun getIsAllowInsecureProtocol(): Property<Boolean>
This method exists only for Kotlin source backward compatibility.
getIsAllowUntrustedServer
Link copied to clipboard
open fun getIsAllowUntrustedServer(): Property<Boolean>
This method exists only for Kotlin source backward compatibility.
getIsEnabled
Link copied to clipboard
@ReplacedBy(value = "getEnabled()")
open fun getIsEnabled(): Property<Boolean>
Controls whether the build cache is enabled.
getIsPush
Link copied to clipboard
@ReplacedBy(value = "getPush()")
open fun getIsPush(): Property<Boolean>
Controls whether a given build can store outputs in the build cache.
getIsUseExpectContinue
Link copied to clipboard
open fun getIsUseExpectContinue(): Property<Boolean>
This method exists only for Kotlin source backward compatibility.
getPush
Link copied to clipboard
abstract fun getPush(): Property<Boolean>
Controls whether a given build can store outputs in the build cache.
getUrl
Link copied to clipboard
abstract fun getUrl(): Property<URI>
Returns the URI to the cache.
getUseExpectContinue
Link copied to clipboard
abstract fun getUseExpectContinue(): Property<Boolean>
Specifies whether HTTP expect-continue should be used for store requests.
setUrl
Link copied to clipboard
open fun setUrl(url: String)
Sets the URL of the cache.