Class HttpCacheSettings
This class contains all options related to the UserAgent's HTTP cache.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleansetDirectory(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
HttpCacheSettingsinstance.
-
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
UserAgentmay use it. If you try to create a newUserAgentwithHttpCacheSettingsthat have the same path, the constructor will throw an exception.- Returns:
- The current
HttpCacheSettingsinstance.
-
setMaxEntries
The maximum number of entries in the cache. Defaults to 100.
- Returns:
- The current
HttpCacheSettingsinstance.
-
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
HttpCacheSettingsinstance.
-