Skip to content

Conversation

@kikkomep
Copy link
Member

@kikkomep kikkomep commented Nov 26, 2025

This pull request extends the existing HTTP caching functionality in the RO-Crate validator.

Previously, caching was available only at the session level and was transient. Now, a persistent cache can be enabled by specifying a cache path and maximum age. The session cache remains active by default for repeated requests within a session, while the persistent cache allows caching across multiple sessions.

The cache stored at a specific path (as specified by cache-path) can be migrated between different systems, potentially supporting the scenario described in #115.

Cache parameters can be configured via new CLI options --cache-max-age, --cache-path, or programmatically through the corresponding internal settings.

The --no-cache option allows ignoring any existing cache, forcing requests to bypass cached data.

[addresses #114 and #115]

Comment on lines +206 to +212
@click.option(
'--cache-max-age',
type=click.INT,
default=constants.DEFAULT_HTTP_CACHE_MAX_AGE,
show_default=True,
help="Maximum age of the HTTP cache in seconds",
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a way to set this so that the cache never expires? Set to -1?
(I see that -1 in the code but it should be documented if it's allowed here)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants