Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialJames Barrett
13,253 Points2 second load time on a boostrap.min.css file?
Having looked at the network tab and completed a hard refresh, I noticed that my bootstrap.min.css file took almost 2 seconds to load. Is this bad? Would this be a drawback of using BootStrap?
Moreover, if you saw that it took a long time to request something from the server... What may be going wrong in the code? And what would you do to mitigate this? Also, the same question but for the response time.
Thanks, James.
1 Answer
Abraham Juliot
47,353 PointsHi James, Sorry for the late response! 2 seconds on hard reload is significant. There are few things to consider: 1. Your internet speed. 2. the origin of the source file.
- If internet speed is slow or you're not the only one using your wifi, this could significantly decrease page load speed. 2. Presuming you have a fair internet speed, the server of the source file may be slow at delivering the content to you.
As far as code is concerned, there could be a number issues. They best way to address potential code optimization is to first use a linting tool to check for errors (css lint or js lint), check the console for warnings, and use code optimization best practices--there's a lot of online resource you may google on that note.
And finally, if you are using a commonly used framework or library, it may be beneficial to your visitors to deliver the content through an established content delivery network such as https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css.
Since, a lot of websites use bootstrap, it is possible for your user to have the file cached in their browser before they even visit your site.