diff --git a/AUTHORS b/AUTHORS index 466fe0c..f28df50 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1,7 +1,7 @@ -django-compress was originally created by Andreas Pelme in +django-compress was originally created by Andreas Pelme in 2008. -These people have provided bug fixes, new features, improved the documentation +These people have provided bug fixes, new features, improved the documentation or just made django-compress more awesome. * Alexander Artemenko @@ -11,6 +11,6 @@ or just made django-compress more awesome. * Remco Wendt * Patrick Altman -The Python-version of jsmin (http://www.crockford.com/javascript/jsmin.html) -is included in django-compress. It was translated from to Python by Baruch +The Python-version of jsmin (http://www.crockford.com/javascript/jsmin.html) +is included in django-compress. It was translated from to Python by Baruch Evan, from the original jsmin implementation by Douglas Crockford. diff --git a/README b/README index 3c494f8..8224b6c 100644 --- a/README +++ b/README @@ -1,21 +1,21 @@ -django-compress provides an automated system for compressing CSS and -JavaScript files. By default, it only outputs compressed files while not in -DEBUG-mode. That means you can still debug and edit your source files while -coding, and when going to production, the compressed files will be +django-compress provides an automated system for compressing CSS and +JavaScript files. By default, it only outputs compressed files while not in +DEBUG-mode. That means you can still debug and edit your source files while +coding, and when going to production, the compressed files will be automatically generated. -Support for jsmin and CSSTidy is included and enabled by default (but can -easily be disabled). Support for YUI Compressor is also supported out of the +Support for jsmin and CSSTidy is included and enabled by default (but can +easily be disabled). Support for YUI Compressor is also supported out of the box. -django-compress includes template tags for outputting the URLs to the -CSS/JavaScript?-files and some other goodies to improve the performance of +django-compress includes template tags for outputting the URLs to the +CSS/JavaScript?-files and some other goodies to improve the performance of serving static media. -django-compress is available at github[1] and Google Code[2]. You can always +django-compress is available at github[1] and Google Code[2]. You can always access the latest and greatest code from both git and Subversion. -The documentation is available online at Github[3], or under docs/ in the +The documentation is available online at Github[3], or under docs/ in the source. [1] http://github.com/pelme/django-compress/tree/master diff --git a/docs/BackwardsIncompatibleChanges.textile b/docs/BackwardsIncompatibleChanges.textile index bc953df..a3ca67a 100644 --- a/docs/BackwardsIncompatibleChanges.textile +++ b/docs/BackwardsIncompatibleChanges.textile @@ -18,7 +18,7 @@ bump_filename was broken because a lot of caches does not properly cache files w * The `bump_filename` option was removed from the group settings. There is no need specifying it for ALL groups, if you actually use it, you most likely want to use it on all your compressed files. * The bump_filename options is replaced by the setting COMPRESS_VERSION, and is completely ignored. * The querystring is no longer used to determine a files version, since it was use -* If COMPRESS_VERSION is used, you specify the version part of the `output_filename` file with '?'. This placeholder can be changed with COMPRESS_VERSION_PLACEHOLDER. +* If COMPRESS_VERSION is used, you specify the version part of the `output_filename` file with '?'. This placeholder can be changed with COMPRESS_VERSION_PLACEHOLDER. E.g.:
@@ -30,9 +30,9 @@ E.g.:
 
-* COMPRESS_VERSION requires COMPRESS_AUTO to be enabled. COMPRESS_AUTO is enabled by default, but if you explicitly set it to `False` an ImproperlyConfiguredError exception will be thrown. +* COMPRESS_VERSION requires COMPRESS_AUTO to be enabled. COMPRESS_AUTO is enabled by default, but if you explicitly set it to `False` an ImproperlyConfiguredError exception will be thrown. COMPRESS_AUTO changes * The CSS/Javascript files are not checked during Django's initialization anymore. It was not really useful and did not make sense. The automatic part is now handled by the templatetags (i.e. what used to be COMPRESS_TEMPLATE_AUTO). -* COMPRESS_AUTO is replaced by COMPRESS_AUTO_TEMPLATE, and the old behavior of COMPRESS_AUTO is removed. This might be really confusing, the Configuration should make it clear. \ No newline at end of file +* COMPRESS_AUTO is replaced by COMPRESS_AUTO_TEMPLATE, and the old behavior of COMPRESS_AUTO is removed. This might be really confusing, the Configuration should make it clear. \ No newline at end of file diff --git a/docs/Configuration.textile b/docs/Configuration.textile index 8e05cd4..a44407c 100644 --- a/docs/Configuration.textile +++ b/docs/Configuration.textile @@ -17,7 +17,7 @@ COMPRESS_CSS = { 'media': 'screen,projection', }, }, - + # other CSS groups goes here } @@ -87,19 +87,19 @@ In this example, the template tags will render _http://cdn.example.com/css/one_c h4. CSS URL Replace Filter -This is a really simple filter for doing Python string replacements on your CSS. The use case for this is when you have root relative +This is a really simple filter for doing Python string replacements on your CSS. The use case for this is when you have root relative urls defined in your css:

     body {background-image:url(/media/images/background.gif);}
 
-If you are compiling your media to live on another server, for example if you are deploying the compiled resources to Amazon S3, these -root relative urls will break. That is of course unless you also deploy all the media so they stay relative. However, then you limit yourself +If you are compiling your media to live on another server, for example if you are deploying the compiled resources to Amazon S3, these +root relative urls will break. That is of course unless you also deploy all the media so they stay relative. However, then you limit yourself from being able to prefix the source with a date or version number. Ideally, you should be able to control where the images are deployed and those might be different from where your js/css media are being served from. -This filter offers a very simple solution. Really too simple. One could make the argument for just doing this search and replace manually +This filter offers a very simple solution. Really too simple. One could make the argument for just doing this search and replace manually after the fact, however, I like for my build process to be as automated as possible. Therefore, I want to write down the rules/settings once and be able to repeat the build process when needed without thinking about the find and replace. @@ -113,7 +113,7 @@ Enough babbling, here is an example settings.py section: This will run the CSSURLReplace filter after the CSS is compressed (it is safe to do this in any order, at least for this filter). The URL_REPLACE_HOST is not required, just a variable I defined in my settings file to keep things clean (and to override in other environments -- this is obviously my dev -settings file). +settings file). The COMPRESS_CSS_URL_REPLACE is the only required setting by this filter. It takes a list of tuples, each tuple being exactly two strings. @@ -164,7 +164,7 @@ Output in when settings.COMPRESS = True -Now why is this good you ask? The more script sources the more impact on performence according to http://developer.yahoo.com/performance/rules.html#num_http +Now why is this good you ask? The more script sources the more impact on performence according to http://developer.yahoo.com/performance/rules.html#num_http which is true but if you are low bandwidth or superbig you may want to offload some horsepower to google which leads us as hinted in the example above to the next topic. @@ -173,9 +173,9 @@ currently no reason to have external css files (Yes there are css frameworks asw h4. Google AJAX Libraries API -So the reason for adding external urls support to django-compress is google ajax libraries api support (example above) but you may want to use it however you want. +So the reason for adding external urls support to django-compress is google ajax libraries api support (example above) but you may want to use it however you want. -The advantages for offloading huge javascript libraries to google cdn is of course that your site will need a lot less bandwidth, even if you use far futures expires headers. But the superior reason is of course that the more sites that uses it, the bigger the chance is that your favorite js framework is already cached in your visitors browser. +The advantages for offloading huge javascript libraries to google cdn is of course that your site will need a lot less bandwidth, even if you use far futures expires headers. But the superior reason is of course that the more sites that uses it, the bigger the chance is that your favorite js framework is already cached in your visitors browser. Google also uses far future expires headers so don't worry about that. Don't worry about latency outside the US either. Here in sweden I measuerd a latencey of 39ms. diff --git a/docs/FarFutureExpires.textile b/docs/FarFutureExpires.textile index afaab84..4c00191 100644 --- a/docs/FarFutureExpires.textile +++ b/docs/FarFutureExpires.textile @@ -14,7 +14,7 @@ Most modern browser implement "Heuristic expiration", so it will actually not be This technique obviously has a drawback, when you want to change your files, you need to change their names, since their URLs will be cached... that's right: forever! The solution to that is pretty obvious too: change the URLs. -h3. django-compress with COMPRESS_VERSION +h3. django-compress with COMPRESS_VERSION If you specify COMPRESS_VERSION in your configuration, you can add a placeholder to the filenames to output the version number of the different files. See [Configuration]) for more information. The filename itself will be changed when any of the source files are updated. @@ -66,7 +66,7 @@ h4. nginx nginx's ngx_http_headers_module provides the expires option, which control the Expires and Cache-Control HTTP headers. * [http://wiki.codemongers.com/NginxHttpHeadersModule ngx_http_headers_module in nginx documentation] -h4. Example +h4. Example This will set expiration to the maximum expiration:

diff --git a/docs/Installation.textile b/docs/Installation.textile
index 63d0e3a..cb0b411 100644
--- a/docs/Installation.textile
+++ b/docs/Installation.textile
@@ -10,8 +10,8 @@ h3. Install instructions
 
 # Get the code from svn: svn co http://django-compress.googlecode.com/svn/trunk/ django-compress
 ** Use the setup.py script to install: python setup.py install
-** OR manually put the compress-directory somewhere on your PYTHONPATH 
-# Add 'compress' to your INSTALLED_APPS 
+** OR manually put the compress-directory somewhere on your PYTHONPATH
+# Add 'compress' to your INSTALLED_APPS
 
 h3. Using git?
 
@@ -19,4 +19,4 @@ The main source repository is now available at github: http://github.com/pelme/d
 
 The Subversion repository at Google Code will still be updated, though.
 
-If you want to grab django-compress via git, use: git clone git://github.com/pelme/django-compress.git 
\ No newline at end of file
+If you want to grab django-compress via git, use: git clone git://github.com/pelme/django-compress.git
\ No newline at end of file
diff --git a/docs/Usage.textile b/docs/Usage.textile
index f13eee6..54e1e7f 100644
--- a/docs/Usage.textile
+++ b/docs/Usage.textile
@@ -1,6 +1,6 @@
 h1. Usage
 
-_Describes how to use django-compress when it is installed and configured_ 
+_Describes how to use django-compress when it is installed and configured_
 
 h3. Automated generation
 
@@ -38,4 +38,4 @@ If you have specified the CSS-groups “my_screen_css” and “my_print_css”
 
 h3. Far future Expires
 
-Far future Expires can be used with the bump_filename-option, see the FarFutureExpires page for more information. 
\ No newline at end of file
+Far future Expires can be used with the bump_filename-option, see the FarFutureExpires page for more information.
\ No newline at end of file
diff --git a/docs/Versioning.textile b/docs/Versioning.textile
index 47c3813..f4c11fc 100644
--- a/docs/Versioning.textile
+++ b/docs/Versioning.textile
@@ -39,7 +39,7 @@ from compress.versioning.hash import SHA1Versioning
 
 class ShortSHA1Versioning(SHA1Versioning):
     """Custom SHA1Versioning class"""
-    
+
     def get_version(self, source_files):
         """Return the first 10 characters of the SHA-1 version string"""
         version = super(ShortSHA1Versioning, self).get_version(source_files)