Lessons: 17Length: 1.6 hours

Next lesson playing in 5 seconds

Cancel
  • Overview
  • Transcript

3.5 Moving Assets Externally

Moving assets externally is also referred to as off-loading assets. In essence, you separate your CSS, JavaScript, and images, instead hosting them on a different server.

In this lesson you’ll find out why that’s important.

Related Links

3.5 Moving Assets Externally

Moving assets externally is also referred to as offloading assets, and it basically means separating your CSS, JavaScript, and image files, and hosting them on a different server. Now, you might say, well hold one. A couple of lessons ago you were telling us to limit the number of unique host names to limit the number of DNS lookups, and now you're telling us to offload sites, offload assets to a different site. Well that's true I was saying that, but there is also good reasoning behind what I'm about to tell you now. The thing is its always a good idea to keep your server for your HTML and your CSS file. And maybe for images. But, for JavaScript or any kind of other scripts, It's always good to keep them on an external server. Why? Because it will take the load off your own server. If you're sending requests for a bunch of resources on your server, and other hundreds or thousands of people are doing that at the same time, then your server might have a hard time dealing with this. So you might experience delays. Of course this depends on your hosting, but if your offloading site, if you're offloading your assets, then the task of returning those, of serving those files, JavaScript or CSS frameworks, is on the other server, not yours. Right. So you're gonna deliver the important stuff like HTML and CSS much faster right now and leave the rest of the work for the other server. And you can do this very efficiently by using a CDN or a hosted library like the one Google maintains. Here, you can find pretty much every major JavaScript library you'll ever need. And I'm pretty sure Google has good servers will send the required files really fast. Plus, if you use a maximum of four unique host names, you should be okay in terms of DNS lookups. Also, it's much easier to do it this way. For example, if you're using J Query, instead of going to their website and downloading it and then linking to that in your HTML document. It's much easier just to copy the link from the Google library and paste it in. Really, really fast. You can even offload your images somewhere else. For example, on Flickr. But this might not work if you're doing some sort of a processing server side, in which case you kind of have to, you're gonna have to keep your images on your own server. That's basically it for offloading assets. And by talking about these, we've actually finished with the overall performance. Next up, let's start talking about perceived performance.

Back to the top