sexta-feira, 23 de maio de 2014

Shopping cart with Delphi mORMot

POST #033 =======================================================================
I've created an experimental shopping cart with Delphi 7 which generates HTML. It is a single page application which will have multiple views. I'm using mORMot to render mustache templates. I defend that server-side rendering with mORMot will be always faster than on client side rendering.

When a dynamic page is executing on the server-side, browser is doing nothing but waiting for the HTML to come from the server-side. Here, mORMot code takes only 15ms to perform rendering of my SPA (single page application). By the time server finishes doing its work, server will just send the dynamic content and browser will be able to render it right away. Of course JS/CSS files are loaded only after the page is delivered to the browser.

I've been thinking if I could render a template without refresh the page. Yes, I can. Oh, I have a question: I’m using a external shared template, I’ve been wondering, if this page generated concurrently would become an issue. Are there possibility this become a messed up, a user see another rendered template, for example? Answer is: No, no, TSynMustache is thread-safe, per dedicated template.

Neither javascript framework required nor json on client side, just jquery and mustache templates on server side. 

Tags: shopping cart; jquery with delphi; mORMot web server.