#minify, #Web Development

Minify on the Fly? Probably Not The Best Idea

In order to serve up better performance on my site I minify my JavaScript and css files using cssmin and jsmin (in spite of the author’s exhortations to do otherwise) respectively, but I don’t do it in the most efficient manner possible. I’m basically serving up those cache files on the fly, making it the old school, non production method for doing this. I’m not actually processing the files on the fly, however, only checking to see if a source file has been modified before rebuilding the cache.

I’m running it all through the WordPress wp_enqueue_script/wp_enqueue_style system in my custom theme, but I need to find a method that would work more efficiently in a high traffic environment–not that I have that problem at the moment–instead of serving up those cache files using php.

I thought about running a cron job that would take care of the minification, then just link the theme to minified css or js files. Any ideas?

2 Responses to “Minify on the Fly? Probably Not The Best Idea”

  1. k0nsl

    January 14, 2013 @ 1:32 pm

    Interesting thoughts, unfortunately I have no ideas right now on that particular issue. In fact, I’m looking for ideas on this myself.
    Have you discovered anything new since this post?



  2. Mike

    January 15, 2013 @ 8:15 pm

    The most efficient method is to process the files pre-production, then to just link to the minified files. I built minification into my site based on an older methodology in an effort to reduce work for myself, but I think my site suffers in terms of performance.


Leave a Reply