HTML and CSS Reference
In-Depth Information
The pluses to using the server-side approach are:
• Better security
• Reduces processing expense on client (battery life on mobile, and so on)
• Expandability (adding more servers can increase load capability)
Server-side rendering has its advantages, and if you are creating a web application that
must be connected to the Internet at all times, then you might consider a framework
that falls into this realm. When choosing a server-side framework, however, be sure that
all markup is easily changeable and editable. You don't want to be stuck with a prebuilt
component that is automatically generated and does not allow you to pass through newer
HTML5 attributes and tags.
Overall, the main goal between generating markup on the server or the client should be
to avoid ending up with a huge mess. Most of the time, you'll end up with a hybrid
application that does some processing on the server and much more on the client. So
you want to be sure that the code is properly distributed and organized. Dealing with
two separate code bases that interact with each other takes special care. Using a client
side MV* framework (like Backbone or Knockout) forces a clean separation of concerns
when querying server APIs for data. (You'll learn more about this topic later in the
chapter.)
In regard to recent applications that have taken the step toward more client-side pro‐
cessing, LinkedIn launched its new HTML5-based mobile web app in late 2011
( Figure 4-1 ). The company's mobile development lead gave the following statement in
an interview ( http://venturebeat.com/2011/08/16/linkedin-node ):
The app is 2 to 10 times faster on the client side than its predecessor, and on the server
side, it's using a fraction of the resources, thanks to a switch from Ruby on Rails to
Node.js , a server-side JavaScript development technology that's barely a year old but al‐
ready rapidly gaining traction.
With heavily used applications like LinkedIn's mobile HTML5 web app turning to newer
technologies such as Node.js and JavaScript-heavy client-side code, we can see the world
of web application development evolving and changing. This world is ever-changing
and will continue to change as years go by, but how do we build a performant client-
side solution in today's new world of client- and server-side technologies? Your answer
is at hand. This chapter reviews everything it takes to set up the appropriate HTML5
infrastructure for your web app. Certain APIs, such as WebSockets and Web Storage,
will be given more emphasis and examples in subsequent chapters. Think of this chapter
as a setup script for the rest of the topic.
Search WWH ::




Custom Search