Hi guys,
I have a general question about SSR in Meteor:
Let’s say I have a shop and want everything to be static (SSR or Caching p.e. thru Ngnix), except the “add-to-shopping-cart”-functionality and “your-last-viewed-products-history”-functionality.
How would you approach this as a pro? is this currently possible in Meteor at all? If yes: with what technology?
Kind regards
Barty
I’m not sure if I am a pro , but the first approach that comes to my mind is to:
- Split the app into two apps - the first one (A1) contains pages, which interact with the cart, and the second (A2) - the rest of pages;
- Prerender all the pages (i.e., with PhantomJS) for A2 and put into “public” folder of A1 (you can do it before or after the build of A1 - as you like it)
- Deploy A1 as usual and set up nginx to serve static .html’s
The purpose of splitting the app is to have two different routers - that will prevent A1 to try to render “static” routes.