Server side rendering
Why Questions and Answers Should Be Rendered Server-Side
Rendering Q&A content server-side ensures it's included directly in the HTML, making it fully visible to search engines and AI tools. This improves SEO, increases the chances of appearing in rich results, and ensures your content is accessible to AI-driven platforms from the start.
To make the questions and answers visible to search engines and AI tools, your server simply needs to make a GET request to our API. The response is a raw JSON object containing the questions and answers OR the complete HTML-structure with matching LD+JSON.
A quick start for fetching the questions and answers server-side.
Formating your own display of Questions and Answers
If you want to format your own html for the question structure, and even add the schema you want to use for the questions, that's fine.
The easiest way is to combine Match an exact path and unranked that will give you the same order of questions each time.
An example of a GET request to fetch questions from a specific page (remember to URL encode the parameters if needed):
GET https://api.rekai.se/v1/predictions?projectid=YOUR_PROJECT_ID&secret=YOUR_SECRET&entitytype=rekai-qna&subtree=^/path/to/page/$&unranked=true
Server side caching
Of course, it is important that Questions are rendered as quickly as possible on the page. So if you are fetching them server-side, we recommend that you have a local cache of the response for each page. Although we have our own caching systems, it is of course fastest not to make a request to us on every page view.
If you are using Sitevision you can use their built-in caching system (opens in a new tab) for this.