This inquiry may not be specifically tied to a particular software stack, framework, or coding language.
In the current project I'm working on, we are utilizing AngularJS for developing the front-end with a static landing page that loads real data and renders quickly, making it ideal for CDN use and fast browser loading speeds. However, this architecture can present challenges when it comes to social features. For example, if you share a link on Facebook and the landing page is empty, Facebook will not generate a preview as expected.
(I've heard that Google+ recently started supporting server-side rendering of JavaScript logic before displaying a preview, but this isn't widely supported by other similar platforms. Google.com also indexes JS-based single-page applications.)
Is there a more elegant solution to address this issue without resorting to dynamic pages that include real-time data? Am I overlooking something in my understanding of this problem?
========
I even considered redirecting requests identified as coming from Facebook (via user agent) to a special gateway that uses a tool like PhantomJS to fetch and render the page server-side, sending back a snapshot of the DOM tree as content for Facebook to generate a preview. But I have reservations about whether this approach is wise. :(