Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>We have created a mechanism consisting of the following parts:</p> <ul> <li>minfication (for js and css)</li> <li>aggregation in packages</li> <li>caching (http status 304 stuff)</li> <li>sending out original files for in development mode</li> </ul> <p>It may be too much for your needs, but as to answer your question what others do, here is how it works:</p> <ol> <li>A request comes in at, say, /css.aspx?package=core</li> <li>We do a lookup of the packagename in a xml configuration file (which for instance declares that the package "core" contains the files /js/mootools.js and /js/swfobject.js)</li> <li>We check if minification is enabled. For instance, in a development environment we don't want the minified js contents to be served out, but instead write the original files. For js this is done by document.writes of script includes, and for css we write import rules.</li> <li>If minification is required (in production env) we do a check on the if-modified-since header from the request. If this client already has the minified contents, we send http header 304. If the client does require the contents, we check if we have minified contents in cache and serve that. Otherwise, we minify and send the result.</li> </ol> <p>All this is broken up in separate services. There is a cache service injected in the jsminificationwriter service. This makes use of the original minificationservice that solely takes care of the minification rules.</p> <p>What's nice in this approach is:</p> <ul> <li>It forces our development teams to think in js/css "packages" and therefore properly split up functionality and distribute them over the pages that require them.</li> <li>During development you are perfectly able to debug, getting proper files and line numbers.</li> <li>You can hook up any other minification service implementation such as YUI and so forth. JsMin was only our first take.</li> <li>It's a general approach that works for different content types.</li> </ul> <p>Hope this helps. I can post some code fragments to illustrate it more if you like.</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. 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