I have some pages that I need to render via the server side to make them search engine friendly. For search engines, it should function as a classic website. For users, I want to make the interface more interactive. My thought is to render the page server side, then use knockout and jquery to fetch the data again via ajax and bind it to the page.
I'm concerned about having flashes of no content, or duplicated content. Is there a best practice/pattern for cases like this?
The process would look like this:
- Render page using server side, including a long list of html elements.
- Use jQuery to fetch the same data already rendered to the page.
- Clear server side content with jquery.
- Bind ajax to knockout template, which effectively renders the page as it was previously.
- Subsequent clicks to page through data by a normal user uses ajax and knockout to render the data.
- Search engine can follow standard links to see the same data as the user.
The part I'm hung up on is how to pre-render, clear, and re-render with knockout/jquery.
Maybe my thought process is off a bit, I'd love to hear feedback.