CSS and JS optimization for fewer http requests

Discussion in 'CSS' started by mariuscmr, Dec 7, 2009.

  1. #1
    Hello,

    I'm looking for a script that can combine the whole amount of css files into one single merged css external file sheet. The same with javascript files. I don't want them encrypted as I already have smartoptimizer who minifies and compresses the files. The lack with this useful little script is that it doesn't combine the same type of files (possibly caching it on the server side as well).

    There is a script called Web Optimizer but I don't have a good feeling about it. I tried to use it on a website and it accidentally encrypted some html content and I gave up.

    So, any ideas how can I achieve combining of same types files?

    Thanks,
    Marius
     
    mariuscmr, Dec 7, 2009 IP
  2. andrewpr

    andrewpr Peon

    Messages:
    31
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Hm, you can use bash scripting to write a needed script. But if you are not familiar with linux (or mac), it's hard to do in other systems. Mb find somebody who will help once? ;)
     
    andrewpr, Dec 7, 2009 IP
  3. mariuscmr

    mariuscmr Peon

    Messages:
    84
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Andrew,

    I'm interesting in such a solution for Linux as all my websites are hosted in this environment. Thanks for the tip, but I am sure it can be done with a php script and some .htaccess directives. I don't have full control over the servers so I don't know how can I run a bash script on a shared hosting account.

    Thank you anyway!
     
    mariuscmr, Dec 7, 2009 IP
  4. drhowarddrfine

    drhowarddrfine Peon

    Messages:
    5,428
    Likes Received:
    95
    Best Answers:
    7
    Trophy Points:
    0
    #4
    drhowarddrfine, Dec 7, 2009 IP
  5. mariuscmr

    mariuscmr Peon

    Messages:
    84
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Thanks, I'll take a look.
     
    mariuscmr, Dec 7, 2009 IP
  6. mariuscmr

    mariuscmr Peon

    Messages:
    84
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #6
    I may have missed something, but Minify seems not to be better than Web Optimizer. I have scripts in the header that load dynamically, depending on the current page and Minify cannot combine them "on the fly". You have to build a list with the scripts you want to combine/minify/compress/encrypt.

    Any other solution?

    Thanks.
     
    mariuscmr, Dec 8, 2009 IP
  7. drhowarddrfine

    drhowarddrfine Peon

    Messages:
    5,428
    Likes Received:
    95
    Best Answers:
    7
    Trophy Points:
    0
    #7
    Didn't know you wanted it done on the fly. Didn't check but you should be able to pipe the output of your code into minify and have the output in the form you want. yourscript>minify>your_output

    Maybe he says so here or you can ask him.
     
    drhowarddrfine, Dec 8, 2009 IP
  8. Stomme poes

    Stomme poes Peon

    Messages:
    3,195
    Likes Received:
    136
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Hm, I was reading stuff about JS library optimisation where if you had a gazillion scripts but not every page or situation needed all of them, there was a script which only dished out the scripts needed by the page. However this was pre-built on the server side. Maybe I can find that link, I only read it out of vague interest and was searching for something else.
     
    Stomme poes, Dec 9, 2009 IP