Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>What you're looking for isn't minifying, but compression. Minifying by definition <em>only</em> removes whitespace, since shortening identifiers alters the interface, potentially breaking external scripts that depend on it. For this reason, minifying is inherently 'safer' than compression, although in a closed system (ie. an encapsulated web app), compression can be a good idea.</p> <p><strong>For Javascript</strong>, most people use the <a href="http://developer.yahoo.com/yui/compressor/" rel="noreferrer">YUI Compressor</a> or <a href="http://dean.edwards.name/packer/" rel="noreferrer">Dean Edwards' Packer</a>.</p> <p><strong>For CSS</strong>, there are plenty of tools for 'optimizing' the styles, but I don't know of any that shorten class names as well. The reasons for this could be several:</p> <ol> <li>To compress a CSS file, the script would need to know all HTML files that include it, in order to change the class and id references within them. Depending on your web site's size and structure, his could be non-trivial.</li> <li>After compression, semantic HTML becomes less readable, as <code>&lt;span class="image_caption"&gt;</code> turns into <code>&lt;span class="a12"&gt;</code>, or worse yet, <code>&lt;p id="a12"&gt;</code>.</li> </ol> <p>It would definitely be possible to do something like what you describe (and I'm actually working on a personal CMS/framework that <em>will</em>), but for it to be maintainable, it would probably have to be an integrated part of a tightly structured CMS, compressing all files 'behind the scenes' whenever a new change is published, while keeping all the original files so the site can be maintained as a whole.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload