|
55 | 55 | import org.spdx.Configuration; |
56 | 56 |
|
57 | 57 | /** |
58 | | - * This singleton class provides a configurable download cache for the rest of the library. If enabled, URLs that are |
59 | | - * downloaded using this class will be automatically cached locally on disk (in a directory that adheres to the XDG Base |
60 | | - * Directory Specification - https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html), and any |
61 | | - * subsequent requests will be served out of that cache. Cache entries will be automatically checked for staleness |
62 | | - * (via HTTP ETag requests) on subsequent runs |
| 58 | + * This singleton class provides a flexible download cache for the rest of the library. If enabled, URLs that are |
| 59 | + * requested using this class will have their content automatically cached locally on disk (in a directory that adheres |
| 60 | + * to the XDG Base Directory Specification - https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html), |
| 61 | + * and any subsequent requests will be served out of that cache. Cache entries will also be automatically checked every |
| 62 | + * so often for staleness using HTTP ETag requests (which are more efficient than full HTTP requests). The interval |
| 63 | + * between such checks is configurable (and can even be turned off, which makes every download request re-check the URL |
| 64 | + * for staleness). |
63 | 65 | * |
64 | | - * The class supports these Configuration options: |
65 | | - * org.spdx.storage.listedlicense.enableCache - |
66 | | - * org.spdx.storage.listedlicense.cacheCheckIntervalSecs |
| 66 | + * The cache is configured via these Configuration options: |
| 67 | + * * org.spdx.storage.listedlicense.enableCache: |
| 68 | + * Controls whether the cache is enabled or not. Defaults to false i.e. the cache is disabled. |
| 69 | + * * org.spdx.storage.listedlicense.cacheCheckIntervalSecs: |
| 70 | + * How many seconds should the cache wait between issuing ETag requests to determine whether cached content is |
| 71 | + * stale? Defaults to 86,400 seconds (24 hours). |
67 | 72 | */ |
68 | 73 | public final class DownloadCache { |
69 | 74 | private static final Logger logger = LoggerFactory.getLogger(DownloadCache.class); |
|
0 commit comments