php - balancing Server side and Client side code on a large website -
Let's say I'm programming Facebook (which I'm not) or any other site contains heavy traffic.
Our default layout is:
- All CSS is in external file
- 99% of JS is in external file
- The back bone of the websites is generated by a PHP / MySQL backend.
- JS Functions that usually change, produce the DOM of those parts.
- Our server has an in-display API that returns JSON objects that are fed to our DOM Builders (JS Function), which takes a JSON object, a list of friends, then all HTML To display a list of used friends, or events etc.
Question
- Is this fair?
- Is it normal practice that I mentioned in the DM? Are JS Functions dedicated to the creation of?
- Is this scalable? JS is very slow? (BTW, we use JQuery almost entirely)
I know that it significantly reduces the bandwidth and server load, because the server is no longer through the list of friends Is running (of which it has been inquired for via MySQL) and instead of generating all the HTML, but creating a query and returning a small JSON object that I feel okay, but I'm a 2 / 3rd / 4th / ... should get feedback
very much thank you Adad!
Let me know if there is a lack of any important information.
I think your layout is very good, but I still recommend you to read .
I think the three most important things Facebook does to scale it on:
Ol>
Some other interesting links: