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

exposing jsonld contexts as a separate route #428

Merged
merged 1 commit into from
Jan 14, 2024

Conversation

asdfzdfj
Copy link
Contributor

this problem was pointed out by piefed author
(https://join.piefed.social/2023/11/18/you-can-ignore-json-ld/):

  • for the most part, barely any application actually bothers to parse AP objects as json-ld and just treat it as some shaped json
  • for some type of messages, the overhead of sending json-ld @contexts is bigger than what the message is about, combined with the above point then it's just a waste of data transfers

added a route that returns extra ActivityPub json-ld contexts and uses it as an extra @context in emitted AP objects

a good tradeoff between not wasting data transferring unneeded contexts while still being able parse as a valid json-ld if needed be

this solution is more or less shamelessly replicated from Akkoma/Pleroma, thanks for that.

this problem was pointed out by piefed author
(https://join.piefed.social/2023/11/18/you-can-ignore-json-ld/):
- for the most part, barely any application actually bothers to parse AP
  objects as json-ld and just treat it as some shaped json
- for some type of messages, the overhead of sending json-ld `@contexts`
  is bigger than what the message is about, combined with the above
  point then it's just a waste of data transfers

added a route that returns extra ActivityPub json-ld contexts and uses
it as an extra `@context` in emitted AP objects

a good tradeoff between not wasting data transferring unneeded
contexts while still being able parse as a valid json-ld if needed be

this solution is more or less shamelessly replicated from
Akkoma/Pleroma, thanks for that.
@asdfzdfj asdfzdfj merged commit 6ec513b into main Jan 14, 2024
7 checks passed
@asdfzdfj asdfzdfj deleted the new/jsonld-context-endpoint branch January 14, 2024 11:49
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.

None yet

2 participants