Possible Duplicate:
Why is it a bad practice to return generated HTML instead of JSON? Or is it?
IF I send an AJAX request to a PHP file, what would result in faster rendering of HTML:
I have a rather complex HTML structure, and this puts download time of a large HTML chunk vs. the times Javascript (jQuery) needs to render the same structure.
Is there even a conclusive answer?
You're going to need to measure the times for your situation, because the answer will depend upon:
Server-rendered HTML:
Client-rendered HTML:
This is a case where an hour in the lab running tests before coding could save you from having to redo everything later.
[Added]
Each set of measurements (1, 2, 3) is going to require a different set of tools to capture the data. I would pick 3 sets of representative data (smallest, average, largest) and then for each dataset, make each of the measurements listed above. Note that you don't need to (and in fact shouldn't) use your full application -- you really just want the smallest chunk of code that will do what you want. Then I'd look for the variations between server-rendered and client-rendered, and decide which (if any) was more important in my application.
You're NOT going to be able to measure every possible combination, but if you choose the slowest browser on the slowest PC you can lay your hands on (eg: a cheap netbook), and use the slowest possible internet connection (you've still got an AOL dialup account for testing, right?) that will tend to show you the worst case, which is what you really care about.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With