Reputation: 898
We have a web application with a common header file for all pages. We want to reduce the page load times. We are thinking of having separate headers for different pages, depending on each page's specific javascript and css needs. Will that make any difference in the load time, or not (since they are cached by the browser)?
Upvotes: 2
Views: 210
Reputation: 5939
People have addressed the JS issues already.
CSS includes can also impact page speed noticeably. CSS rules are matched right to left by browsers, which is very different to how most people think about writing their rules. Given a complicated enough layout, CSS optimizations could improve your rendering times significantly.
http://css-tricks.com/efficiently-rendering-css/
http://taligarsiel.com/Projects/howbrowserswork1.htm#CSS_parsing
Why do browsers match CSS selectors from right to left?
Upvotes: 1
Reputation: 22261
Yes. Absolutely.
Many folks clear their cache or even turn it off completely (like me).
Even if the unneeded JavaScript is cached it is still run by the browser.
Check out http://tools.pingdom.com/fpt/.
This tool tests the load time of that page so you can analyze it and find bottlenecks in load time.
When you say different headers what CMS are you talking about? Most CMSs allow you to add additional page head data, JS or CSS, in hooks or ugh placeholders.
Upvotes: 3