SpeculativeLoadingConfig


@Profile.ExperimentalUrlPrefetch
public class SpeculativeLoadingConfig


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

Summary

Constants

static final int

The absolute maximum number of prefetches allowed in cache.

static final int

The default number of prefetches allowed in cache.

static final int

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

Public methods

@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
public static final int ABSOLUTE_MAX_PREFETCHES = 20

The absolute maximum number of prefetches allowed in cache.

DEFAULT_MAX_PREFETCHES

Added in 1.13.0-beta01
public static final int DEFAULT_MAX_PREFETCHES = 10

The default number of prefetches allowed in cache.

DEFAULT_TTL_SECS

Added in 1.13.0-beta01
public static final int DEFAULT_TTL_SECS = 60

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

Public methods

getMaxPrefetches

Added in 1.13.0-beta01
public @IntRange(from = 1, to = 20) int getMaxPrefetches()

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
public @IntRange(from = 1, to = Integer.MAX_VALUE) int getPrefetchTtlSeconds()

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.