SSR, or Server-Side-Rendering, is a mechanism and set of conventions where an application or content is rendered with minimal work from the client.
However, a major trade-off of SSR is having to reload the page for small state changes.
FastComments supports the following features with SSR:
- Customizable commenting widget.
- Anonymous commenting.
- Commenting while logged in.
- Root and nested replies.
- Viewing & paginating comment threads.
- Voting, including anonymous voting.
- Changing the default sort direction.
An example of FastComments SSR is available here.
Example use cases of SSR are as follows:
FastComments uses SSR in the following places:
- We use it as a fallback on our own Blog! https://blog.fastcomments.com
To use FastComments SSR, the client may fetch HTML from the
This can be done a number of ways.
SSR is enabled by default for users without JS enabled as a fallback in the WordPress plugin since version
In a Webpage
With an already existing application, SSR can be added with the following example, assuming the language used is PHP:
We can also only show the SSR UI when the user has JS disabled:
For an example using SSO, see here.
With Pre-Rendered Content
Our blog is generated at build time, and provides a good example of SSR with Handlebars.
The Basic Parameters
The basic parameters that you need to pass are:
tenantId- This identifies you as a customer.
urlId- This identifies the page or article to load comments for, and defines where they are saved.
url- This is used for notifications and related features to link back to the comment thread.
As such, you must tune this as desired.