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

Figure out how to cache & load LD-Contexts #26

Closed
decentralgabe opened this issue Feb 28, 2022 · 4 comments
Closed

Figure out how to cache & load LD-Contexts #26

decentralgabe opened this issue Feb 28, 2022 · 4 comments
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed json-ld

Comments

@decentralgabe
Copy link
Member

LD Contexts should be loaded and cached without making web requests. Web servers go down, and when they do, they shouldn't stop us from verifying data. I'm not sure if this is a capability of https://github.com/piprate/json-gold

@decentralgabe decentralgabe added enhancement New feature or request help wanted Extra attention is needed labels Feb 28, 2022
@decentralgabe decentralgabe self-assigned this Feb 28, 2022
@decentralgabe
Copy link
Member Author

Looks like we should be able to inline replace known context URIs with full context documents https://github.com/piprate/json-gold/blob/master/ld/context.go#L116

@georgepadayatti
Copy link

Also, it adds an additional latency if there is no cache support. Facing the same problem in a project that I am working.
https://github.com/decentralised-dataexchange/acapy-mydata-did-protocol

@singyiu
Copy link
Contributor

singyiu commented Jun 13, 2022

PR pending review.

json-gold does have the caching document loader implemented (RFC7324)
It is enabled by passing the caching loader into the ldProcessor options
Added it as the default option here.

Json-ld context can be loaded as a json-ld document (type map[string]interface{}) using the loadDocument function test example
or further converting it into a json-gold.Context object test example
A helper function "GetContextFromMap" was added.

@decentralgabe
Copy link
Member Author

Fixed in #102

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed json-ld
Projects
None yet
Development

No branches or pull requests

3 participants