Skip to content

jkotchoff/minified_cache

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DESCRIPTION
===========
This monkey patch of ActionView::Helpers::AssetTagHelper uses the jsmin library to minify cached
javascript so that you can pass the YSlow test! When you call: 

    <%= javascript_include_tag 'application', 'other_js_source', :cache => 'application_cached' %>

then the resulting generated #{RAILS_ROOT}/public/javascripts/application_cached.js will be
served minified (assuming config.action_controller.perform_caching = true)

INSTALLATION
=============
git clone git://github.com/cornflakesuperstar/minified_cache.git vendor/plugins/minified_cache && rm -rf vendor/plugins/minified_cache/.git
 
WARNING
=======
In order to minify your javascript, it must be formatted with appropriate function closure and 
braces eg:

    if(condition) alert('msg')
    else alert('othermsg')

is handled gracefully by browsers (thanks to the newline), however when it gets compressed to:

    if(condition) alert('msg')else alert('othermsg')

you can expect some kaboom. 

check out http://www.jslint.com/ to verify your scripts

HOMEPAGE
========
http://www.kangarooit.com/minified_cache


Copyright (c) 2009 Jason Kotchoff, released under the MIT license

About

Monkey Patches javascript_include_tag...:cache =>... to use jsmin for optimized javascript

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages