0

For one of our customer using RWS 9.6 DXA , we serve the published pages using Cloudfront behind Load balancer. In few scenarios we get the published page output in JSON format (it shows all Page content field values in JSON format on the browser). Not sure from where its getting generated or the root cause. Any insight or clue to troubleshoot will be really helpful.

Thanks.

1 Answer 1

2

Regarding the unexpected JSON output issue you're encountering with your DXA implementation behind CloudFront and a load balancer, it's important to consider how the DXA framework handles page requests and responses.

By default, DXA is designed to load the appropriate Page Model based on the requested page URL, map it to the corresponding View Model, and then render it as HTML for web display. However, DXA also supports the option to return JSON format if explicitly requested via the URL query string, typically by appending ?format=json to the page URL. This functionality is useful for scenarios where applications need to consume page content in JSON format rather than as rendered HTML.

In your case, where pages are unexpectedly rendered in JSON format, it's possible that something in your environment is altering the request headers, specifically the content type and accept type, which might prompt the DXA framework to return JSON instead of HTML.

To troubleshoot this issue effectively, I recommend the following steps:

  1. Examine Request Headers: When encountering the JSON output, inspect the request headers to see if the content type and accept type headers are being modified. This information can provide insights into what might be triggering the unexpected behavior.

  2. Review Customizations and Configurations: Take a closer look at any custom middleware, CDN settings, or other environment configurations that could potentially impact the handling of requests and formatting of responses. Pay particular attention to any components that interact with request headers or manipulate response content.

  3. Check for Additional Query Parameters: Verify if any additional query parameters are being appended to the page URLs, potentially triggering the JSON response format. This can help identify any unintentional modifications to the request that might be influencing the DXA framework's behavior.

By thoroughly investigating these aspects, you should be able to pinpoint the root cause of the issue and implement the necessary adjustments or fixes to ensure consistent rendering of pages in the expected HTML format.

I hope it helps to troubleshoot your issue.

1
  • Thank you, Velumurugan. I'll troubleshoot further and check.
    – user2166
    Commented Apr 16 at 5:38

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.