2 BACKROUND
Over the years, the web has evolved from simple
text content from one server to a complex ecosystem
with different types of content from multiple servers
under different administrative domains (Butkiewicz
2011). Rendering a single web page involves
fetching several objects with varying file types. A
typical web page can include HTML, CSS, and
image files. JavaScript files can be used to provide
client-side functionality, such as functions, plug-ins,
applets, and so forth. These files can be called the
resources of a web page.
These resources can be optimized in many ways
(Hongkiat 2015, Rajeev 2015). This optimization
generally involves editing the resources to optimize
scripts, HTML or CSS codes for faster loading. The
optimization also tries to reduce the number of
resources for reducing the number of required HTTP
request and response messages. Also client side
caching can be used for performance optimization
(Ali 2011).
The performance of the website can be evaluated
in many ways (Soininen 2012). Performance can be
defined as the time within a certain operation is
executed. A common meter regarding to the
performance of a web page is the time it takes to
load a page. Page load speeds have been typically
measured as the time it takes for two events to occur
on the page. These events are DOMContentLoaded
and Load/Onload.
The DOMContentLoaded event fires after the
HTML code has been fully retrieved from the server
and the complete DOM tree has been created. This
event does not necessarily require that any images or
style sheets have been loaded. This means that the
render tree can now be built. Instead, the Load event
fires after the entire page has been fully downloaded,
processed, and rendered including all images,
stylesheets, and scripts. After the Load event, some
resources can still be loaded in an asynchronous
way. So, the unofficial term of Totally Loaded can
be used for a time unit, when all the resources are
totally loaded. Related to the load times, Butkiewicz
(2011) says that rather than the total number of bytes
fetched to render a website, the number of objects
fetched is the most dominant indicator of client-
perceived load times.
Performance can also be defined as the capability
of executing a number of operations within a unit of
time. With websites, this means that how many
concurrent users the website can serve. In general,
the performance of the system has to be good
enough during the peak time to satisfy user needs.
To figure out the moment of the top usage, the log
files of the web server have to be analysed.
3 OPTIMIZATION WORK
The optimized website is ForeAmmatti. It is a web
service which offers information in respect of the
labour market of Finland. Data content of the
ForeAmmatti information system had been
significantly increased during the last few years. The
dynamic production of the content in the HTML
pages had always been done with the fastest and
easiest way because of the very fast development
work. The new features and contents had been added
with speed. Therefore, the performance of the
solutions had not received major consideration.
There was a clear need for optimization because
most of HTML pages and their resources were
enormously big considering both the file sizes and
the amount of characters.
After the optimization, some JavaScript files are
still loaded in a synchronous way. Otherwise, the
optimization work was done almost in a perfect way.
So, the optimized result achieved was better than
only using the optimization tools offered by browser
developers. The next subsections presents the most
essential points related to this optimization work.
3.1 Occupation Selectors
The most beneficial modification was the redesign
of the occupation selectors. The text content of those
is actually static, but the amount of choices is user
dependent and the order is editable by a user. The
original method was not efficient enough. In the
server side, the java code ran a database query for
fetching the appropriate occupation list. After that,
these list items were put inside the HTML table
items. These table items also included JavaScript
code for fetching the occupation related information
from the database after the user click. A few
hundred occupations were typically included to the
front page. So, the solution was very simple, but
unfortunately inefficient.
In the optimization work, it was given up using
HTML tables with the occupation selectors. Using
the Ajax concept (Deitel 2012) there is no longer
any need to load the whole occupation list to the
client side. Ajax is a client-side script that
communicates to and from a server/database without
the need for a complete page refresh. Based on the
needs of a user, it is now possible to update only parts
of a web page without the need of reloading the entire