[Checkins] SVN: hurry.resource/trunk/src/hurry/resource/README.txt Added notes about optimization.

Martijn Faassen faassen at infrae.com
Wed Oct 15 12:42:28 EDT 2008


Log message for revision 92236:
  Added notes about optimization.
  

Changed:
  U   hurry.resource/trunk/src/hurry/resource/README.txt

-=-
Modified: hurry.resource/trunk/src/hurry/resource/README.txt
===================================================================
--- hurry.resource/trunk/src/hurry/resource/README.txt	2008-10-15 16:31:26 UTC (rev 92235)
+++ hurry.resource/trunk/src/hurry/resource/README.txt	2008-10-15 16:42:27 UTC (rev 92236)
@@ -169,6 +169,44 @@
 now. While this is a bit more cumbersome to use in application code, it is
 easier to read for the purposes of this document.
 
+A note on optimization
+======================
+
+There are various optimizations for resource inclusion that
+``hurry.resource`` supports. Because some optimizations can make
+debugging more difficult, the optimizations are disabled by default.
+
+We will summarize the optimization features here and tell you how to
+enable them. Later sections below go into more details.
+
+* minified resources. Resources can specify minified versions using
+  the mode system. You can use ``hurry.resource.mode('minified')``
+  somewhere in the request handling of your application. This will
+  make sure that resources included on your page are supplied as
+  minified versions, if these are available. 
+
+* rolling up of resources.  Resource libraries can specify rollup
+  resources that combine multiple resources into one. This reduces the
+  amount of server requests to be made by the web browser, and can
+  help with caching. To enable rolling up, call
+  ``hurry.resource.rollup`` somewhere in your request handling.
+
+* javascript inclusions at the bottom of the web page. If your
+  framework integration uses the special ``render_topbottom`` method,
+  you can enable the inclusion of javascript files at the bottom by
+  calling ``hurry.resource.bottom()``. This will only include
+  resources at the bottom that have explicitly declared themselves to
+  be *bottom-safe*. You can declare a resource bottom safe by passing
+  ``bottom=True`` when constructing a ``ResourceInclusion``. If you
+  want to force all javascript to be including at the bottom of the
+  page by default, you can call ``hurry.resource.bottom(force=True)``.
+
+To find out more about these and other optimizations, please read this
+`best practices article`_ that describes some common optimizations to
+speed up page load times.
+
+.. _`best practices article`: http://developer.yahoo.com/performance/rules.html
+
 Multiple requirements
 =====================
 



More information about the Checkins mailing list