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

Use known, statically cached DFC context #11323

Merged
merged 3 commits into from
Aug 16, 2023

Conversation

mkllnk
Copy link
Member

@mkllnk mkllnk commented Aug 3, 2023

ℹ️ This is a funded feature. Please use the Clockify project with the following name when working on this, including review and test: #9170 OFN DFC Products

What? Why?

The JSON-LD standard recommends caching contexts and the used Ruby library supports this very well. I wish I had known this before. Now we can:

  • Reduce our document size, just referring to the context URI.
  • Always use our cached version of the context instead trying to load it via the URI from the DFC website.
  • Be protected from outages, flaky network or breaking changes.

What should we test?

  • No test. Not in production use, nothing to test.

Release notes

Changelog Category: Technical changes

The title of the pull request will be included in the release notes.

Dependencies

Documentation updates

We want to use the preloaded context when exporting documents as well.
We wanted to use our own context before but now I found a better way for
the connector to cache the context and therfore we can use the original
implementation again.
@mkllnk mkllnk self-assigned this Aug 3, 2023
@mkllnk mkllnk marked this pull request as ready for review August 3, 2023 06:58
Copy link
Collaborator

@rioug rioug left a comment

Choose a reason for hiding this comment

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

Much simpler !

Copy link
Contributor

@jibees jibees left a comment

Choose a reason for hiding this comment

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

Yeah, seems way simpler!!! GG

@jibees
Copy link
Contributor

jibees commented Aug 14, 2023

No test. Not in production use, nothing to test.

I'v moved this one into 'Ready to go', please feel free to merge @mkllnk !

@mkllnk mkllnk merged commit fd7b00a into openfoodfoundation:master Aug 16, 2023
54 checks passed
@mkllnk mkllnk deleted the dfc-import-context branch August 16, 2023 01:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Use known DFC context when importing documents with the DFC context URL
3 participants