Possibility to opt-out from rels inlining in StoryblokClient.get() #839
Labels
has-workaround
[Issue] Temporary solutions available.
pending-triage
[Issue] Ticket is pending to be prioritised
Context
We are using Redis on our end to save fetch request times and have data as close to the app as possible. However, there is one functionality StoryblokClient provides, which is rels inlining, when the resolve_relations option is used.
FYI, we are using
storyblok/astro
, and when passingresolve_relations
it does 2 things with the same flag:rels: [{...}]
Problem
For bigger pages, we have huge (~10MB+) story json objects returned from StoryblokClient.get(…), caused by relations inserting to the object, which is not possible to opt-out. However, we still need to pass resolve_relations which would instruct Content Delivery API to resolve them and return via
rels:[{...}]
array (this is very useful, as using client all fetching content comes out-of-the-box, and need for direct link building and fetching).We have estimated that if StoryblokClient would not inline those relations it would be only 500kb story json which we cache and do the inlining ourselves after we get story from Redis cache. That would be ideal!! Adding a diagram to showcase our business case.
This implies a couple of following ways to think of:
Temporary workaround
In cases when we have
resolve_relations
we are doing the following branched-out logic specifically:Though looking into what is recommended in Reducing the size of the response it only refers to
Content Deliver API
, hence our problem is that Storyblok Client also reacts toresolve_relations
and does the inlining part why do not need.Unfortunately, we cannot use the StoryblokClient for such cases due to missing opt-out functionality. Or maybe there are other ways to solve the issue we are not aware of?
The text was updated successfully, but these errors were encountered: