What would be the advantages and disadvantages of implementing a web application with the following architecture:
Simple server that simply serves JSON responses of data, and HTML with templates to be rendered in the client. The client side be a javascript MVC "application" that receives and caches HTML the templates and asks for data in JSON format as needed. The js is the heart and logic of the application, implementing all the behaviour and interaction.
In this particular scenario, the server would ask as a repository of data and as a server of HTML templates. The client receives the templates and caches them for later (using offline storage, why not) rendering them with the JSON data in the browser itself.
I can see some upsides to this:
- The browser only requests just the necessary data and templates, making it work with a very low bandwidth. Caching the templates is a big plus.
- The server is quite simple, and may even be implemented in javascript using Node.js to allow for a graceful fallback for browsers that have javascript disabled by rendering the templates in the server and sending the generated html in the response.
and some downsides:
- More requests are made as templates and data are requested separately
- In a bare bones application of this idea, it doesn't work if the user has javascript disabled.
I've been thinking about this for a while, and I don't know how crazy this idea is, and if there are current implementations of this, or even if this has a name. Any extra advantages or disadvantages? Any existing implementations?
Feel free to close it if this idea does indeed have a name and a question exists about it.
If I had the rep, I'd make this a community wiki, but I can't.