Is these way can Reduce HTTP Requests?

multiple javascript files with & symbol

<script type="text/javascript"

multiple css files with @ import

<style type="text/css">
@import url(css/style.css);
@import url(css/custom.css);
  • 4
    Why don't you combine them instead ? By the way, I don't think every browser will understand the & where did you see that? (and this lead to a 400 bad request from yahoo)
    – j0k
    Commented Sep 4, 2012 at 15:34
  • 1
    Load the JS at the bottom of the page: it won't save you requests, but the page will load a lot faster. As j0k said, combine them. Also minify them if they are not already.
    – ionFish
    Commented Sep 4, 2012 at 15:36
  • @j0k, ionFish, the problem is the js file like yui and jquery, It is impossible combine them with some software like jsmin.exe, because the licence, and impossible load them in the bottom of the page, many javascript code with relay on them will not work.
    – Giberno
    Commented Sep 4, 2012 at 15:41
  • If you can use all your jquery code inside a $(document).ready() function, then you can load the jquery file just before the js/jquery code (as described by ionFish). In some cases that you have some onclick="javascriptcodehere" or similar, and you cannot refactor it to load the script once the document is ready, then you will have to load it on top. Try to use popular CDN for jquery and popular scripts/css: often your visitors will already have the file cached and will not require a full request.
    – milo5b
    Commented Sep 4, 2012 at 15:45
  • ok, so @milo5b, any other way to Reduce HTTP Requests? something like jquery $.getScript?
    – Giberno
    Commented Sep 4, 2012 at 16:03

1 Answer 1


The 2 examples are minified versions served from popular CDN, so many visitors will have them in their cache, and therefore no HTTP request will be required.

If you want to combine them, download the files and then you need to do some kind of combining the files on the server side. If you are using .NET SquishIt is a popular choice. If you use PHP minify is an option.

In regard to the CSS files, the above two options support those as well.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.