Class HttpCacheSettings
This class contains all options related to the UserAgent
's HTTP cache.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
setDirectory
(Path value) Configures the file system path to the HTTP cache.setEnabled
(Boolean value) Enables the HTTP cache.setMaxEntries
(Integer maxEntries) The maximum number of entries in the cache.setMaxObjectSize
(Long maxObjectSize) The maximum size that any one particular cache object can have in bytes.
-
Constructor Details
-
HttpCacheSettings
public HttpCacheSettings()
-
-
Method Details
-
getEnabled
-
isEnabled
public boolean isEnabled() -
setEnabled
Enables the HTTP cache. This will cause PDFreactor to cache all resources loaded over HTTP(S) in a browser-like fashion according to their cache headers.
- Returns:
- The current
HttpCacheSettings
instance.
-
setDirectory
Configures the file system path to the HTTP cache. If no path is defined, resources will be cached in-memory. If a path is specified, only one
UserAgent
may use it. If you try to create a newUserAgent
withHttpCacheSettings
that have the same path, the constructor will throw an exception.- Returns:
- The current
HttpCacheSettings
instance.
-
setMaxEntries
The maximum number of entries in the cache. Defaults to 100.
- Returns:
- The current
HttpCacheSettings
instance.
-
setMaxObjectSize
The maximum size that any one particular cache object can have in bytes. If the object's size exceeds this value, the object won't be cached. Defaults to 5,000,000 (5 MB).
- Returns:
- The current
HttpCacheSettings
instance.
-