SpeculativeLoadingConfig


@Profile.ExperimentalUrlPrefetch
class SpeculativeLoadingConfig


Represents a configuration for speculative loading in a Profile instance. This should be set using setSpeculativeLoadingConfig

Summary

Constants

const Int

The absolute maximum number of prefetches allowed in cache.

const Int

The default number of prefetches allowed in cache.

const Int

The default Time-to-Live (TTL) in seconds for prefetched data.

Public functions

@IntRange(from = 1, to = 20) Int

The max amount of prefetches that can live in the cache.

@IntRange(from = 1, to = Integer.MAX_VALUE) Int

The "time to live" for a prefetch inside of the prefetch cache.

Constants

ABSOLUTE_MAX_PREFETCHES

Added in 1.13.0-beta01
const val ABSOLUTE_MAX_PREFETCHES = 20: Int

The absolute maximum number of prefetches allowed in cache.

DEFAULT_MAX_PREFETCHES

Added in 1.13.0-beta01
const val DEFAULT_MAX_PREFETCHES = 10: Int

The default number of prefetches allowed in cache.

DEFAULT_TTL_SECS

Added in 1.13.0-beta01
const val DEFAULT_TTL_SECS = 60: Int

The default Time-to-Live (TTL) in seconds for prefetched data.

Public functions

getMaxPrefetches

Added in 1.13.0-beta01
fun getMaxPrefetches(): @IntRange(from = 1, to = 20) Int

The max amount of prefetches that can live in the cache. Defaults to DEFAULT_MAX_PREFETCHES.

Cannot exceed ABSOLUTE_MAX_PREFETCHES.

getPrefetchTtlSeconds

Added in 1.13.0-beta01
fun getPrefetchTtlSeconds(): @IntRange(from = 1, to = Integer.MAX_VALUE) Int

The "time to live" for a prefetch inside of the prefetch cache. This is representative of the maximum time that a prefetch is considered valid and can be served to a navigation. This value is in seconds and defaults to DEFAULT_TTL_SECS.