1

We have a requirement that during the page loads we need to check whether that page is published from all the child publications or not. Based on that result, we need to add those URLs to the page.

In our current implementation, we have a list of child publications. In the page controller, we are looping through that list and checking if this page exists(using GraphQL query)or not. This approach is definitely increasing the number of calls to the API, and sometimes it is throwing 502 error -

Sdl.Tridion.Api.GraphQL.Client.Exceptions.GraphQLClientException: Failed to get http response from 'https://.tridion.sdlproducts.com/cd/api' with request: HttpRequest: Path= Method=POST ContentType=application/json ---> Sdl.Tridion.Api.Http.Client.Exceptions.HttpClientException: Failed to get http response from 'https://.tridion.sdlproducts.com/cd/api' with request: HttpRequest: Path= Method=POST ContentType=application/json ---> System.Net.WebException: The remote server returned an error: (502) Bad Gateway.

I am looking for an option where we can get the result in one shot. Any suggestion?

Note*: I am using DXA 2.2 with Sites 9.1

4
  • Are the links for some kind of language selector for the given page? Aug 11, 2022 at 3:58
  • Hi Alvin it is more related to the canonical url and alternate url Aug 11, 2022 at 18:57
  • Okay, make sense. That's to tell search engines about variations of the page for like devices and/or languages? Maybe add your current queries and expected output for figure out the error. In terms of optimizing the queries, I'm thinking the two approaches would be to use dynamic page linking as a more CM/"classic" approach or looking into Customizing GraphQL querying. How do you manage the sitemap? Any chance you could move the logic there? Aug 12, 2022 at 13:17
  • Thank you for the suggestion. I will try to add custom schema to the GraphQL client and update the answer Aug 15, 2022 at 20:09

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.