Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Caching of json-ld context documents #32

Open
pietercolpaert opened this issue Apr 19, 2024 · 3 comments
Open

Caching of json-ld context documents #32

pietercolpaert opened this issue Apr 19, 2024 · 3 comments

Comments

@pietercolpaert
Copy link
Member

In rdf-derefence you can pass a custom fetch function: https://www.npmjs.com/package/rdf-dereference#input-using-a-custom-fetch-function

I wonder if there’s a way to implement regular HTTP caching, but only for the JSON-LD context documents if they need to be fetched externally. In the LDES client it otherwise does not make sense to have HTTP caching that stores the full response, as it is never going to be used again.

@MPvHarmelen
Copy link
Contributor

I also noticed the lack of http caching in the client and came here to write an issue, but it's already there! 🥳

It otherwise does not make sense to have HTTP caching that stores the full response, as it is never going to be used again.

When developing a client (in the sense of "something that uses whatever ldes-client spits out"), caching the full http responses is actually very useful: during development one frequently resends exactly the same requests, because some other part of the code changed.

Also because the spec mentions http caching explicitly (in the first note of section 2), I expected the ldes-client to respect the cache headers.

@pietercolpaert
Copy link
Member Author

The ldes-client is going to respect caching headers on a second run if you pass a state file location though using -s. Does that fix your problem?

@MPvHarmelen
Copy link
Contributor

I didn't release the client implements its own caching, thanks!

Later it turned out that the endpoint that I was developing against doesn't return cache-control headers, so I think that was the root cause... 🤦

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

No branches or pull requests

2 participants