<s>
A	O
single-page	B-Application
application	I-Application
(	O
SPA	O
)	O
is	O
a	O
web	B-Application
application	I-Application
or	O
website	O
that	O
interacts	O
with	O
the	O
user	O
by	O
dynamically	O
rewriting	O
the	O
current	O
web	O
page	O
with	O
new	O
data	O
from	O
the	O
web	B-Application
server	I-Application
,	O
instead	O
of	O
the	O
default	O
method	O
of	O
a	O
web	B-Application
browser	I-Application
loading	O
entire	O
new	O
pages	O
.	O
</s>
<s>
The	O
goal	O
is	O
faster	O
transitions	O
that	O
make	O
the	O
website	O
feel	B-Application
more	O
like	O
a	O
native	B-Language
app	B-Application
.	O
</s>
<s>
In	O
a	O
SPA	O
,	O
a	O
page	O
refresh	O
never	O
occurs	O
;	O
instead	O
,	O
all	O
necessary	O
HTML	B-Language
,	O
JavaScript	B-Language
,	O
and	O
CSS	B-Language
code	O
is	O
either	O
retrieved	O
by	O
the	O
browser	B-Application
with	O
a	O
single	O
page	O
load	O
,	O
or	O
the	O
appropriate	O
resources	O
are	O
dynamically	O
loaded	O
and	O
added	O
to	O
the	O
page	O
as	O
necessary	O
,	O
usually	O
in	O
response	O
to	O
user	O
actions	O
.	O
</s>
<s>
The	O
origins	O
of	O
the	O
term	O
single-page	B-Application
application	I-Application
are	O
unclear	O
,	O
though	O
the	O
concept	O
was	O
discussed	O
at	O
least	O
as	O
early	O
as	O
2003	O
by	O
technology	O
evangelists	O
from	O
Netscape	O
.	O
</s>
<s>
Stuart	O
Morris	O
,	O
a	O
programming	O
student	O
at	O
Cardiff	O
University	O
,	O
Wales	O
,	O
wrote	O
the	O
Self-Contained	O
website	O
at	O
slashdotslash.com	O
with	O
the	O
same	O
goals	O
and	O
functions	O
in	O
April	O
2002	O
,	O
and	O
later	O
the	O
same	O
year	O
Lucas	O
Birdeau	O
,	O
Kevin	O
Hakman	O
,	O
Michael	O
Peachey	O
and	O
Clifford	O
Yeh	O
described	O
a	O
single-page	B-Application
application	I-Application
implementation	O
in	O
US	O
patent	O
8,136,109	O
.	O
</s>
<s>
Earlier	O
forms	O
were	O
called	O
rich	B-Application
web	I-Application
applications	I-Application
.	O
</s>
<s>
JavaScript	B-Language
can	O
be	O
used	O
in	O
a	O
web	B-Application
browser	I-Application
to	O
display	O
the	O
user	B-Application
interface	I-Application
(	O
UI	O
)	O
,	O
run	O
application	B-Architecture
logic	I-Architecture
,	O
and	O
communicate	O
with	O
a	O
web	B-Application
server	I-Application
.	O
</s>
<s>
Mature	O
free	B-Application
libraries	O
are	O
available	O
that	O
support	O
the	O
building	O
of	O
a	O
SPA	O
,	O
reducing	O
the	O
amount	O
of	O
JavaScript	B-Language
code	O
developers	O
have	O
to	O
write	O
.	O
</s>
<s>
There	O
are	O
various	O
techniques	O
available	O
that	O
enable	O
the	O
browser	B-Application
to	O
retain	O
a	O
single	O
page	O
even	O
when	O
the	O
application	O
requires	O
server	O
communication	O
.	O
</s>
<s>
HTML	B-Language
authors	O
can	O
leverage	O
element	O
IDs	O
to	O
show	O
or	O
hide	O
different	O
sections	O
of	O
the	O
HTML	B-Language
document	O
.	O
</s>
<s>
Then	O
,	O
using	O
CSS	B-Language
,	O
authors	O
can	O
use	O
the	O
`	O
#target	O
`	O
selector	O
to	O
only	O
show	O
the	O
section	O
of	O
the	O
page	O
which	O
the	O
browser	B-Application
navigated	O
to	O
.	O
</s>
<s>
Web	B-Application
browser	I-Application
JavaScript	B-Language
frameworks	I-Language
and	O
libraries	O
,	O
such	O
as	O
AngularJS	B-Application
,	O
Ember.js	B-Language
,	O
ExtJS	B-Language
,	O
Knockout.js	B-Language
,	O
Meteor.js	B-Language
,	O
React	B-Application
,	O
Vue.js	B-Language
,	O
and	O
Svelte	B-Language
have	O
adopted	O
SPA	O
principles	O
.	O
</s>
<s>
Aside	O
from	O
ExtJS	B-Language
,	O
all	O
of	O
these	O
are	O
free	B-Application
.	O
</s>
<s>
AngularJS	B-Application
is	O
a	O
fully	O
client-side	O
framework	O
.	O
</s>
<s>
AngularJS	B-Application
's	O
templating	O
is	O
based	O
on	O
bidirectional	O
UI	B-General_Concept
data	I-General_Concept
binding	I-General_Concept
.	O
</s>
<s>
The	O
HTML	B-Language
template	O
is	O
compiled	O
in	O
the	O
browser	B-Application
.	O
</s>
<s>
The	O
compilation	O
step	O
creates	O
pure	O
HTML	B-Language
,	O
which	O
the	O
browser	B-Application
re-renders	O
into	O
the	O
live	O
view	O
.	O
</s>
<s>
In	O
traditional	O
server-side	O
HTML	B-Language
programming	O
,	O
concepts	O
such	O
as	O
controller	O
and	O
model	O
interact	O
within	O
a	O
server	O
process	O
to	O
produce	O
new	O
HTML	B-Language
views	O
.	O
</s>
<s>
In	O
the	O
AngularJS	B-Application
framework	O
,	O
the	O
controller	O
and	O
model	O
states	O
are	O
maintained	O
within	O
the	O
client	O
browser	B-Application
.	O
</s>
<s>
Angular	O
2+	O
is	O
a	O
SPA	O
Framework	O
developed	O
by	O
google	O
after	O
angularjs	B-Application
.	O
</s>
<s>
Ember.js	B-Language
is	O
a	O
client-side	O
JavaScript	B-Language
web	B-Application
application	I-Application
framework	O
based	O
on	O
the	O
model	O
–	O
view	O
–	O
controller	O
(	O
MVC	O
)	O
software	O
architectural	O
pattern	O
.	O
</s>
<s>
It	O
allows	O
developers	O
to	O
create	O
scalable	O
single-page	B-Application
applications	I-Application
by	O
incorporating	O
common	O
idioms	O
and	O
best	O
practices	O
into	O
a	O
framework	O
that	O
provides	O
a	O
rich	O
object	O
model	O
,	O
declarative	B-Language
two-way	O
data	O
binding	O
,	O
computed	O
properties	O
,	O
automatically	O
updating	O
templates	O
powered	O
by	O
Handlebars.js	B-Language
,	O
and	O
a	O
router	O
for	O
managing	O
application	O
state	O
.	O
</s>
<s>
ExtJS	B-Language
is	O
also	O
a	O
client	O
side	O
framework	O
that	O
allows	O
creating	O
MVC	O
applications	O
.	O
</s>
<s>
The	O
application	O
built	O
with	O
ExtJS	B-Language
can	O
either	O
exist	O
on	O
its	O
own	O
(	O
with	O
state	O
in	O
the	O
browser	B-Application
)	O
or	O
with	O
the	O
server	O
(	O
e.g.	O
</s>
<s>
with	O
REST	O
API	B-Application
that	O
is	O
used	O
to	O
fill	O
its	O
internal	O
stores	O
)	O
.	O
</s>
<s>
ExtJS	B-Language
has	O
only	O
built	O
in	O
capabilities	O
to	O
use	O
localStorage	O
so	O
larger	O
applications	O
need	O
a	O
server	O
to	O
store	O
state	O
.	O
</s>
<s>
Knockout.js	B-Language
is	O
a	O
client	O
side	O
framework	O
which	O
uses	O
templates	O
based	O
on	O
the	O
Model-View-ViewModel	O
pattern	O
.	O
</s>
<s>
Meteor.js	B-Language
is	O
a	O
full-stack	O
(	O
client-server	O
)	O
JavaScript	B-Language
framework	I-Language
designed	O
exclusively	O
for	O
SPAs	O
.	O
</s>
<s>
It	O
features	O
simpler	O
data	O
binding	O
than	O
Angular	O
,	O
Ember	O
or	O
ReactJS	B-Application
,	O
and	O
uses	O
the	O
Distributed	B-Protocol
Data	I-Protocol
Protocol	I-Protocol
and	O
a	O
publish	B-Operating_System
–	I-Operating_System
subscribe	I-Operating_System
pattern	I-Operating_System
to	O
automatically	O
propagate	O
data	O
changes	O
to	O
clients	O
in	O
real-time	O
without	O
requiring	O
the	O
developer	O
to	O
write	O
any	O
synchronization	O
code	O
.	O
</s>
<s>
Ecosystem	O
packages	O
such	O
as	O
Server	O
Side	O
Rendering	O
address	O
the	O
problem	O
of	O
Search	B-Application
Engine	I-Application
Optimization	O
.	O
</s>
<s>
React	B-Application
is	O
a	O
JavaScript	B-Language
library	I-Language
for	O
building	O
user	B-Application
interfaces	I-Application
.	O
</s>
<s>
It	O
is	O
maintained	O
by	O
Facebook	B-Application
,	O
Instagram	B-Application
and	O
a	O
community	O
of	O
individual	O
developers	O
and	O
corporations	O
.	O
</s>
<s>
React	B-Application
uses	O
a	O
new	O
language	O
which	O
is	O
a	O
mix	O
of	O
JS	O
and	O
HTML	B-Language
(	O
a	O
subset	O
of	O
HTML	B-Language
)	O
.	O
</s>
<s>
Several	O
companies	O
use	O
React	B-Application
with	O
Redux	B-Language
(	O
JavaScript	B-Language
library	I-Language
)	O
which	O
adds	O
state	O
management	O
capabilities	O
,	O
which	O
(	O
with	O
several	O
other	O
libraries	O
)	O
lets	O
developers	O
create	O
complex	O
applications	O
.	O
</s>
<s>
Vue.js	B-Language
is	O
a	O
JavaScript	B-Language
framework	I-Language
for	O
building	O
user	B-Application
interfaces	I-Application
.	O
</s>
<s>
Svelte	B-Language
is	O
a	O
framework	O
for	O
building	O
user	B-Application
interfaces	I-Application
that	O
compiles	O
Svelte	B-Language
code	O
to	O
JavaScript	B-Language
DOM	B-General_Concept
(	O
Document	B-General_Concept
Object	I-General_Concept
Model	I-General_Concept
)	O
manipulations	O
,	O
avoiding	O
the	O
need	O
to	O
bundle	O
a	O
framework	O
to	O
the	O
client	O
,	O
and	O
allowing	O
for	O
simpler	O
application	O
development	O
syntax	O
.	O
</s>
<s>
As	O
of	O
2006	O
,	O
the	O
most	O
prominent	O
technique	O
used	O
was	O
Ajax	B-Device
.	O
</s>
<s>
Ajax	B-Device
involves	O
using	O
asynchronous	O
requests	O
to	O
a	O
server	O
for	O
XML	B-Protocol
or	O
JSON	B-General_Concept
data	O
,	O
such	O
as	O
with	O
JavaScript	B-Language
's	O
XMLHttpRequest	B-Protocol
or	O
more	O
modern	O
fetch( )	O
(	O
since	O
2017	O
)	O
,	O
or	O
the	O
deprecated	O
ActiveX	B-Library
Object	I-Library
.	O
</s>
<s>
In	O
contrast	O
to	O
the	O
declarative	B-Language
approach	O
of	O
most	O
SPA	O
frameworks	O
,	O
with	O
Ajax	B-Device
the	O
website	O
directly	O
uses	O
JavaScript	B-Language
or	O
a	O
JavaScript	B-Language
library	I-Language
such	O
as	O
jQuery	B-Language
to	O
manipulate	O
the	B-General_Concept
DOM	I-General_Concept
and	O
edit	O
HTML	B-Language
elements	O
.	O
</s>
<s>
Ajax	B-Device
has	O
further	O
been	O
popularized	O
by	O
libraries	O
like	O
jQuery	B-Language
,	O
which	O
provides	O
a	O
simpler	O
syntax	O
and	O
normalizes	O
Ajax	B-Device
behavior	O
across	O
different	O
browsers	B-Application
which	O
historically	O
had	O
varying	O
behavior	O
.	O
</s>
<s>
WebSockets	B-Protocol
are	O
a	O
bidirectional	O
real-time	O
client-server	O
communication	O
technology	O
that	O
are	O
part	O
of	O
the	O
HTML5	B-Application
specification	O
.	O
</s>
<s>
For	O
real-time	O
communication	O
,	O
their	O
use	O
is	O
superior	O
to	O
Ajax	B-Device
in	O
terms	O
of	O
performance	O
and	O
simplicity	O
.	O
</s>
<s>
Server-sent	B-Language
events	I-Language
(	O
SSEs	O
)	O
is	O
a	O
technique	O
whereby	O
servers	O
can	O
initiate	O
data	O
transmission	O
to	O
browser	B-Application
clients	O
.	O
</s>
<s>
SSEs	O
are	O
sent	O
over	O
traditional	O
HTTP	O
and	O
have	O
a	O
variety	O
of	O
features	O
that	O
WebSockets	B-Protocol
lack	O
by	O
design	O
such	O
as	O
automatic	O
reconnection	O
,	O
event	O
IDs	O
,	O
and	O
the	O
ability	O
to	O
send	O
arbitrary	O
events	O
.	O
</s>
<s>
Although	O
this	O
method	O
is	O
outdated	O
,	O
asynchronous	O
calls	O
to	O
the	O
server	O
may	O
also	O
be	O
achieved	O
using	O
browser	B-Application
plug-in	O
technologies	O
such	O
as	O
Silverlight	B-Application
,	O
Flash	B-Operating_System
,	O
or	O
Java	B-Application
applets	I-Application
.	O
</s>
<s>
Requests	O
to	O
the	O
server	O
typically	O
result	O
in	O
either	O
raw	O
data	O
(	O
e.g.	O
,	O
XML	B-Protocol
or	O
JSON	B-General_Concept
)	O
,	O
or	O
new	O
HTML	B-Language
being	O
returned	O
.	O
</s>
<s>
In	O
the	O
case	O
where	O
HTML	B-Language
is	O
returned	O
by	O
the	O
server	O
,	O
JavaScript	B-Language
on	O
the	O
client	O
updates	O
a	O
partial	O
area	O
of	O
the	B-General_Concept
DOM	I-General_Concept
(	O
Document	B-General_Concept
Object	I-General_Concept
Model	I-General_Concept
)	O
.	O
</s>
<s>
When	O
raw	O
data	O
is	O
returned	O
,	O
often	O
a	O
client-side	O
JavaScript	B-Language
XML	B-Protocol
/	O
(	O
XSL	B-Language
)	O
process	O
(	O
and	O
in	O
the	O
case	O
of	O
JSON	B-General_Concept
a	O
template	O
)	O
is	O
used	O
to	O
translate	O
the	O
raw	O
data	O
into	O
HTML	B-Language
,	O
which	O
is	O
then	O
used	O
to	O
update	O
a	O
partial	O
area	O
of	O
the	B-General_Concept
DOM	I-General_Concept
.	O
</s>
<s>
A	O
SPA	O
moves	O
logic	O
from	O
the	O
server	O
to	O
the	O
client	O
,	O
with	O
the	O
role	O
of	O
the	O
web	B-Application
server	I-Application
evolving	O
into	O
a	O
pure	O
data	O
API	B-Application
or	O
web	O
service	O
.	O
</s>
<s>
In	O
this	O
way	O
,	O
when	O
any	O
request	O
hits	O
the	O
server	O
(	O
usually	O
user	O
actions	O
)	O
,	O
the	O
server	O
sends	O
the	O
appropriate	O
HTML	B-Language
and/or	O
JavaScript	B-Language
with	O
the	O
concrete	O
changes	O
to	O
bring	O
the	O
client	O
to	O
the	O
new	O
desired	O
state	O
(	O
usually	O
adding/deleting/updating	O
a	O
part	O
of	O
the	O
client	O
DOM	B-General_Concept
)	O
.	O
</s>
<s>
Most	O
of	O
the	O
logic	O
is	O
executed	O
on	O
the	O
server	O
,	O
and	O
HTML	B-Language
is	O
usually	O
also	O
rendered	O
on	O
the	O
server	O
.	O
</s>
<s>
In	O
some	O
ways	O
,	O
the	O
server	O
simulates	O
a	O
web	B-Application
browser	I-Application
,	O
receiving	O
events	O
and	O
performing	O
delta	O
changes	O
in	O
server	O
state	O
which	O
are	O
automatically	O
propagated	O
to	O
client	O
.	O
</s>
<s>
The	O
client	O
page	O
sends	O
data	O
representing	O
its	O
current	O
state	O
to	O
the	O
server	O
,	O
usually	O
through	O
Ajax	B-Device
requests	O
.	O
</s>
<s>
Using	O
this	O
data	O
,	O
the	O
server	O
is	O
able	O
to	O
reconstruct	O
the	O
client	O
state	O
of	O
the	O
part	O
of	O
the	O
page	O
which	O
needs	O
to	O
be	O
modified	O
and	O
can	O
generate	O
the	O
necessary	O
data	O
or	O
code	O
(	O
for	O
instance	O
,	O
as	O
JSON	B-General_Concept
or	O
JavaScript	B-Language
)	O
,	O
which	O
is	O
returned	O
to	O
the	O
client	O
to	O
bring	O
it	O
to	O
a	O
new	O
state	O
,	O
usually	O
modifying	O
the	O
page	O
DOM	B-General_Concept
tree	I-General_Concept
according	O
to	O
the	O
client	O
action	O
that	O
motivated	O
the	O
request	O
.	O
</s>
<s>
At	O
the	O
same	O
time	O
,	O
this	O
approach	O
is	O
more	O
easily	O
scalable	O
because	O
there	O
is	O
no	O
per-client	O
page	O
data	O
kept	O
in	O
the	O
server	O
and	O
,	O
therefore	O
,	O
Ajax	B-Device
requests	O
can	O
be	O
dispatched	O
to	O
different	O
server	O
nodes	O
with	O
no	O
need	O
for	O
session	O
data	O
sharing	O
or	O
server	O
affinity	O
.	O
</s>
<s>
If	O
such	O
a	O
SPA	O
wants	O
to	O
store	O
and	O
update	O
data	O
,	O
it	O
must	O
use	O
browser-based	B-Application
Web	B-Application
Storage	I-Application
.	O
</s>
<s>
These	O
applications	O
benefit	O
from	O
advances	O
available	O
with	O
HTML5	B-Application
.	O
</s>
<s>
Because	O
the	O
SPA	O
is	O
an	O
evolution	O
away	O
from	O
the	O
stateless	O
page-redraw	O
model	O
that	O
browsers	B-Application
were	O
originally	O
designed	O
for	O
,	O
some	O
new	O
challenges	O
have	O
emerged	O
.	O
</s>
<s>
Client-side	O
JavaScript	B-Language
libraries	I-Language
.	O
</s>
<s>
The	O
evolution	O
of	O
browsers	B-Application
and	O
the	O
HTML5	B-Application
specification	O
,	O
designed	O
for	O
the	O
SPA	O
model	O
.	O
</s>
<s>
Because	O
of	O
the	O
lack	O
of	O
JavaScript	B-Language
execution	O
on	O
crawlers	O
of	O
some	O
popular	O
Web	B-Application
search	I-Application
engines	I-Application
,	O
SEO	O
(	O
Search	B-Application
engine	I-Application
optimization	O
)	O
has	O
historically	O
presented	O
a	O
problem	O
for	O
public	O
facing	O
websites	O
wishing	O
to	O
adopt	O
the	O
SPA	O
model	O
.	O
</s>
<s>
Between	O
2009	O
and	O
2015	O
,	O
Google	B-Application
Webmaster	I-Application
Central	I-Application
proposed	O
and	O
then	O
recommended	O
an	O
"	O
AJAX	B-Device
crawling	O
scheme	O
"	O
using	O
an	O
initial	O
exclamation	O
mark	O
in	O
fragment	O
identifiers	O
for	O
stateful	O
AJAX	B-Device
pages	O
( #	O
!	O
)	O
.	O
</s>
<s>
Special	O
behavior	O
must	O
be	O
implemented	O
by	O
the	O
SPA	O
site	O
to	O
allow	O
extraction	O
of	O
relevant	O
metadata	O
by	O
the	O
search	B-Application
engine	I-Application
's	O
crawler	O
.	O
</s>
<s>
For	O
search	B-Application
engines	I-Application
that	O
do	O
not	O
support	O
this	O
URL	O
hash	O
scheme	O
,	O
the	O
hashed	O
URLs	O
of	O
the	O
SPA	O
remain	O
invisible	O
.	O
</s>
<s>
These	O
"	O
hash-bang	O
"	O
URIs	O
have	O
been	O
considered	O
problematic	O
by	O
a	O
number	O
of	O
writers	O
including	O
Jeni	O
Tennison	O
at	O
the	O
W3C	O
because	O
they	O
make	O
pages	O
inaccessible	O
to	O
those	O
who	O
do	O
not	O
have	O
JavaScript	B-Language
activated	O
in	O
their	O
browser	B-Application
.	O
</s>
<s>
They	O
also	O
break	O
HTTP	B-Protocol
referer	I-Protocol
headers	O
as	O
browsers	B-Application
are	O
not	O
allowed	O
to	O
send	O
the	O
fragment	O
identifier	O
in	O
the	O
Referer	B-Protocol
header	I-Protocol
.	O
</s>
<s>
In	O
2015	O
,	O
Google	O
deprecated	O
their	O
hash-bang	O
AJAX	B-Device
crawling	O
proposal	O
.	O
</s>
<s>
In	O
2018	O
,	O
Google	O
introduced	O
dynamic	O
rendering	O
as	O
another	O
option	O
for	O
sites	O
wishing	O
to	O
offer	O
crawlers	O
a	O
non-JavaScript	O
heavy	O
version	O
of	O
a	O
page	O
for	O
indexing	O
purposes	O
.	O
</s>
<s>
This	O
approach	O
involves	O
your	O
web	B-Application
server	I-Application
detecting	O
crawlers	O
(	O
via	O
the	O
user	O
agent	O
)	O
and	O
routing	O
them	O
to	O
a	O
renderer	O
,	O
from	O
which	O
they	O
are	O
then	O
served	O
a	O
simpler	O
version	O
of	O
HTML	B-Language
content	O
.	O
</s>
<s>
Because	O
SEO	O
compatibility	O
is	O
not	O
trivial	O
in	O
SPAs	O
,	O
it	O
is	O
worth	O
noting	O
that	O
SPAs	O
are	O
commonly	O
not	O
used	O
in	O
a	O
context	O
where	O
search	B-Application
engine	I-Application
indexing	O
is	O
either	O
a	O
requirement	O
,	O
or	O
desirable	O
.	O
</s>
<s>
In	O
the	O
cases	O
where	O
these	O
applications	O
are	O
consumer	O
products	O
,	O
often	O
a	O
classic	O
"	O
page	O
redraw	O
"	O
model	O
is	O
used	O
for	O
the	O
applications	O
landing	O
page	O
and	O
marketing	O
site	O
,	O
which	O
provides	O
enough	O
meta	O
data	O
for	O
the	O
application	O
to	O
appear	O
as	O
a	O
hit	O
in	O
a	O
search	B-Application
engine	I-Application
query	O
.	O
</s>
<s>
Blogs	O
,	O
support	O
forums	O
,	O
and	O
other	O
traditional	O
page	O
redraw	O
artifacts	O
often	O
sit	O
around	O
the	O
SPA	O
that	O
can	O
seed	O
search	B-Application
engines	I-Application
with	O
relevant	O
terms	O
.	O
</s>
<s>
One	O
way	O
to	O
increase	O
the	O
amount	O
of	O
code	O
that	O
can	O
be	O
shared	O
between	O
servers	O
and	O
clients	O
is	O
to	O
use	O
a	O
logic-less	O
template	O
language	O
like	O
Mustache	B-Language
or	O
Handlebars	O
.	O
</s>
<s>
Such	O
templates	O
can	O
be	O
rendered	O
from	O
different	O
host	O
languages	O
,	O
such	O
as	O
Ruby	B-Language
on	O
the	O
server	O
and	O
JavaScript	B-Language
in	O
the	O
client	O
.	O
</s>
<s>
However	O
,	O
merely	O
sharing	O
templates	O
typically	O
requires	O
duplication	O
of	O
business	B-Architecture
logic	I-Architecture
used	O
to	O
choose	O
the	O
correct	O
templates	O
and	O
populate	O
them	O
with	O
data	O
.	O
</s>
<s>
To	O
avoid	O
these	O
problems	O
,	O
applications	O
can	O
use	O
UI	B-General_Concept
data	I-General_Concept
bindings	I-General_Concept
or	O
granular	O
DOM	B-General_Concept
manipulation	O
to	O
only	O
update	O
the	O
appropriate	O
parts	O
of	O
the	O
page	O
instead	O
of	O
re-rendering	O
entire	O
templates	O
.	O
</s>
<s>
With	O
a	O
SPA	O
being	O
,	O
by	O
definition	O
,	O
"	O
a	O
single	O
page	O
"	O
,	O
the	O
model	O
breaks	O
the	O
browser	B-Application
's	O
design	O
for	O
page	O
history	O
navigation	O
using	O
the	O
"	O
forward	O
"	O
or	O
"	O
back	O
"	O
buttons	O
.	O
</s>
<s>
This	O
presents	O
a	O
usability	O
impediment	O
when	O
a	O
user	O
presses	O
the	O
back	O
button	O
,	O
expecting	O
the	O
previous	O
screen	O
state	O
within	O
the	O
SPA	O
,	O
but	O
instead	O
,	O
the	O
application	O
's	O
single	O
page	O
unloads	O
and	O
the	O
previous	O
page	O
in	O
the	O
browser	B-Application
's	O
history	O
is	O
presented	O
.	O
</s>
<s>
The	O
traditional	O
solution	O
for	O
SPAs	O
has	O
been	O
to	O
change	O
the	O
browser	B-Application
URL	O
's	O
hash	O
fragment	O
identifier	O
in	O
accord	O
with	O
the	O
current	O
screen	O
state	O
.	O
</s>
<s>
This	O
can	O
be	O
achieved	O
with	O
JavaScript	B-Language
,	O
and	O
causes	O
URL	O
history	O
events	O
to	O
be	O
built	O
up	O
within	O
the	O
browser	B-Application
.	O
</s>
<s>
To	O
further	O
address	O
this	O
issue	O
,	O
the	O
HTML5	B-Application
specification	O
has	O
introduced	O
and	O
providing	O
programmatic	O
access	O
to	O
the	O
actual	O
URL	O
and	O
browser	B-Application
history	O
.	O
</s>
<s>
Analytics	O
tools	O
such	O
as	O
Google	B-Application
Analytics	I-Application
rely	O
heavily	O
upon	O
entire	O
new	O
pages	O
loading	O
in	O
the	O
browser	B-Application
,	O
initiated	O
by	O
a	O
new	O
page	O
load	O
.	O
</s>
<s>
Failing	O
to	O
call	O
such	O
a	O
function	O
,	O
the	O
browser	B-Application
never	O
triggers	O
a	O
new	O
page	O
load	O
,	O
nothing	O
gets	O
added	O
to	O
the	O
browser	B-Application
history	O
,	O
and	O
the	O
analytics	O
package	O
has	O
no	O
idea	O
who	O
is	O
doing	O
what	O
on	O
the	O
site	O
.	O
</s>
<s>
Similarly	O
to	O
the	O
problems	O
encountered	O
with	O
search	B-Application
engine	I-Application
crawlers	O
,	O
DAST	O
tools	O
may	O
struggle	O
with	O
these	O
JavaScript-rich	O
applications	O
.	O
</s>
<s>
Problems	O
can	O
include	O
the	O
lack	O
of	O
hypertext	O
links	O
,	O
memory	O
usage	O
and	O
resources	O
loaded	O
by	O
the	O
SPA	O
typically	O
being	O
made	O
available	O
by	O
an	O
Application	B-Application
Programming	I-Application
Interface	I-Application
or	O
API	B-Application
.	O
</s>
<s>
Single	B-Application
Page	I-Application
Applications	I-Application
are	O
still	O
subject	O
to	O
the	O
same	O
security	O
risks	O
as	O
traditional	O
web	O
pages	O
such	O
as	O
Cross-Site	O
Scripting	O
(	O
XSS	O
)	O
,	O
but	O
also	O
a	O
host	O
of	O
other	O
unique	O
vulnerabilities	O
such	O
as	O
Data	O
Exposure	O
via	O
API	B-Application
and	O
Client	O
Side	O
Logic	O
&	O
Client-Side	O
Enforcement	O
of	O
Server-Side	O
Security	O
.	O
</s>
<s>
In	O
order	O
to	O
effectively	O
scan	O
a	O
Single	B-Application
Page	I-Application
Application	I-Application
,	O
a	O
DAST	O
scanner	O
must	O
be	O
able	O
to	O
navigate	O
the	O
client-side	O
application	O
in	O
a	O
reliable	O
and	O
repeatable	O
manner	O
to	O
allow	O
discovery	O
of	O
all	O
areas	O
of	O
the	O
application	O
and	O
interception	O
of	O
all	O
requests	O
that	O
the	O
application	O
sends	O
to	O
remote	O
servers	O
(	O
e.g.	O
</s>
<s>
API	B-Application
requests	O
)	O
.	O
</s>
<s>
It	O
is	O
possible	O
to	O
add	O
page	O
load	O
events	O
to	O
a	O
SPA	O
using	O
the	O
HTML5	B-Application
history	O
API	B-Application
;	O
this	O
will	O
help	O
integrate	O
analytics	O
.	O
</s>
<s>
Some	O
frameworks	O
provide	O
free	B-Application
analytics	O
integrations	O
addressing	O
most	O
of	O
the	O
major	O
analytics	O
providers	O
.	O
</s>
<s>
But	O
it	O
's	O
not	O
possible	O
to	O
get	O
away	O
from	O
the	O
fact	O
that	O
it	O
needs	O
to	O
download	O
the	O
framework	O
,	O
at	O
least	O
some	O
of	O
the	O
application	O
code	O
;	O
and	O
will	O
hit	O
an	O
API	B-Application
for	O
data	O
if	O
the	O
page	O
is	O
dynamic	O
.	O
</s>
<s>
The	O
SPA	O
approach	O
on	O
the	O
web	O
is	O
similar	O
to	O
the	O
single-document	O
interface	O
(	O
SDI	O
)	O
presentation	O
technique	O
popular	O
in	O
native	B-Language
desktop	B-Application
applications	I-Application
.	O
</s>
