You are here

README.txt in Javascript Aggregator 6

Same filename and directory in other branches
  1. 5 README.txt
JavaScript Aggregator for Drupal 6
==================================

The JavaScript Aggregator module for Drupal 6 will minify the
aggregated JavaScript file when the Optimize JavaScript option
is enabled in admin/settings/performance. This is done through
the fantastic JSMin library:
http://code.google.com/p/jsmin-php/


Installation
------------

 1) Copy the JavaScript Aggregator module to sites/all/modules.

 2) Enable it in admin/build/modules.

 3) Enable JavaScript Optimization in admin/settings/performance.
 
 4) See that the aggregated JavaScript file now ends with ".jsmin.js",
    and contains minified JavaScript.

 5) Optionally compress the JavaScript even more by enabling GZip
    compression.


Upgrading
---------

The Drupal 5 version of the JavaScript Aggregator module required
the addition of some code to your theme. This is not so in the
Drupal 6 version. In the Drupal 6 version, you just have to enable
the module and you're done. This is due to the use of hook_preprocess_page.

Thank you goes to webchick and her writings of the jQuery Update module
for the idea of using the hook.


Issues
------
Certain hosts do not like multiple .htaccess files. To get around this issue you need to:

(1) copy the text below into drupal's root .htaccess file

(2) enable the "GZip JS: Do not generate .htaccess file" checkbox, together with the option "GZip JavaScript"


Add this Inside the <IfModule mod_rewrite.c> block, right before </IfModule> (add it to the bottom)
  ### START JS GZIP ###
    <Files *.js.gz>
      AddEncoding x-gzip .gz
      ForceType text/javascript
    </Files>

    RewriteCond %{HTTP_USER_AGENT} !".*Safari.*"
    RewriteCond %{HTTP:Accept-encoding} gzip
    RewriteCond %{REQUEST_FILENAME}.gz -f
    RewriteRule ^(.*)\.js $1.js.gz [L,QSA]
  ### End JS GZIP ###

File

README.txt
View source
  1. JavaScript Aggregator for Drupal 6
  2. ==================================
  3. The JavaScript Aggregator module for Drupal 6 will minify the
  4. aggregated JavaScript file when the Optimize JavaScript option
  5. is enabled in admin/settings/performance. This is done through
  6. the fantastic JSMin library:
  7. http://code.google.com/p/jsmin-php/
  8. Installation
  9. ------------
  10. 1) Copy the JavaScript Aggregator module to sites/all/modules.
  11. 2) Enable it in admin/build/modules.
  12. 3) Enable JavaScript Optimization in admin/settings/performance.
  13. 4) See that the aggregated JavaScript file now ends with ".jsmin.js",
  14. and contains minified JavaScript.
  15. 5) Optionally compress the JavaScript even more by enabling GZip
  16. compression.
  17. Upgrading
  18. ---------
  19. The Drupal 5 version of the JavaScript Aggregator module required
  20. the addition of some code to your theme. This is not so in the
  21. Drupal 6 version. In the Drupal 6 version, you just have to enable
  22. the module and you're done. This is due to the use of hook_preprocess_page.
  23. Thank you goes to webchick and her writings of the jQuery Update module
  24. for the idea of using the hook.
  25. Issues
  26. ------
  27. Certain hosts do not like multiple .htaccess files. To get around this issue you need to:
  28. (1) copy the text below into drupal's root .htaccess file
  29. (2) enable the "GZip JS: Do not generate .htaccess file" checkbox, together with the option "GZip JavaScript"
  30. Add this Inside the block, right before (add it to the bottom)
  31. ### START JS GZIP ###
  32. AddEncoding x-gzip .gz
  33. ForceType text/javascript
  34. RewriteCond %{HTTP_USER_AGENT} !".*Safari.*"
  35. RewriteCond %{HTTP:Accept-encoding} gzip
  36. RewriteCond %{REQUEST_FILENAME}.gz -f
  37. RewriteRule ^(.*)\.js $1.js.gz [L,QSA]
  38. ### End JS GZIP ###