WordPress.org

Forums

[Plugin: WP Minify] Gzip but not minify? (12 posts)

  1. Steven Vachon
    Member
    Posted 5 years ago #

    I do my own minification to CSS and JavaScript locally. I'd like to serve a single cached gzip archive containing all css/js files but skip the minification process. Is this possible?

    Or have I confused how this plugin is meant to function?

    http://wordpress.org/extend/plugins/wp-minify/

  2. Milan Dinić
    Member
    Posted 5 years ago #

    If I understood you, you want to have one file where you'll concatenate all other file and gzip them, but without minification.

    Why you don't want minification?

  3. Steven Vachon
    Member
    Posted 5 years ago #

    Multiple, separate CSS files... crammed into a *.gzip

    I have many cascades going on, so I cannot merge all files into 1 *.css file.

  4. Steven Vachon
    Member
    Posted 5 years ago #

    Since I received no response, I'll assume that's not how gzip works with browsers.

    How about separating the 3 options-- combine, minify, gzip?

    As I said, I have lots of cascading going on, so the files need to be separate. But I could definitely benefit from gzip and caching. I may not enable minifying cuz I prefer to use the Dojo Toolkit for that.

  5. Milan Dinić
    Member
    Posted 5 years ago #

    Sorry I didn't respond you earlier.

    First, you must separate few things since you are equalizing them. There are three things important here: gziping, concatenating and minifying.

    Gzip compression is reduction of size of content and is working between server and browser (not visible to users). Read more about it here, here and here.

    Concatenation is combining two or more files (CSS or JS) in one. Why is this done? Because one larger file is loaded faster than many smaller one. Read more here and here.

    Minification is reducing size of content by removing comments, white space characters and other unnecessary characters. You can read more about it here, here and here.

    WP Minify will do this all automatically for you. It will concatenate all CSS and JS files, minify them (if they are not already minified) and deliver them to browsers compressed. This is not in contrary to what you want.

    I hope that this solved all confusion.

  6. Steven Vachon
    Member
    Posted 5 years ago #

    Thanks for clearing up the terms.

    What I'd like is to:

    1. enable Gzip compression
    2. disable concatenation - my css files are separated because of cascading and I cannot merge them without my site design breaking
    3. disable minification - speeds things up since I manually minify my css/js files
  7. Milan Dinić
    Member
    Posted 5 years ago #

    You don't need plugin for this. What you need is to simply edit .htaccess file in root of your installation and place this three lines:

    Note that everything between ifmodule tags need to be in one line (simply copy it from here).

    This will compress all your textual content (html, css, javascript, xml,...). If you don't want some type to be compressed, simply remove it from line. You can use this for any site, not just ones powered by WordPress.

    Though I don't understand that thing about cascading in second item, could you explain it better?

  8. Milan Dinić
    Member
    Posted 5 years ago #

    For some reason my code can't be sent here, I belive it is because of company's proxy server, will send you when I'm at home.

  9. Steven Vachon
    Member
    Posted 5 years ago #

    Hmm, I thought your plugin did the gzip compression and cached the file for future use. That way Apache wouldn't need to handle it every time it gets a request for the file.

  10. Milan Dinić
    Member
    Posted 5 years ago #

    Its not my plugin, though author implemented some of mine ideas :)

    I think that there is no such option in Minify, on which WP Minify is based.

    And here is code I promised above:

    <IfModule mod_deflate.c>
    AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css application/javascript application/x-javascript application/x-httpd-php application/rss+xml application/atom_xml
    </IfModule>

    Btw, you didn't tell me about cascading thing.

  11. Steven Vachon
    Member
    Posted 5 years ago #

    I did, but that's unimportant. :P

    Thanks for the apache code :)

  12. archon810
    Member
    Posted 5 years ago #

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags