Using Content Delivery Network to load your static resources
When you have multiple static resources in your page such as CSS, JavaScript, and images, it's always beneficial to use a Content Delivery Network (CDN) to parallelize downloading these resources and distribute them across different domain names. Even if you don't have different domain names, you can use the same domain with different sub-domains in order to trick the browser into believing that there are different domain names.
In this recipe, we are going to use a CDN to fetch skin, images, videos, and JavaScript files. You can grab this project's recipe by cloning the ADFFacesWithCDN
application from the Git repository.
Getting ready
Add an entry of your machine name under your host's file with an entry as follows:
127.0.0.1 adffaces js.adffaces.local static.adffaces.local skin.adffaces.local
You can find the hosts
file at the following locations:
C:\Windows\System32\drivers\etc\hosts
(Windows)/etc/hosts
(Linux)/private/etc/hosts
...