yui-minify-resources - no minified resources on production system

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

yui-minify-resources - no minified resources on production system

carina
Hi,

I'm using the yui-minify-resources plugin with Grails 2.0.0.RC1 to compress the resources that I defined using the resources plugin. I use it in combination with zipped-resources and cached-resources and it works fine locally when I use prod run-war.

However, the minified resources are not used on the production system: the bundled resources are included instead of the minified ones. When I try to open the URL of a minified resource manually, it is not available. The configuration on the production system is hardly any different from the local configuration and I did not find and warnings, error messages or related differences in the log file when running the application or while the war file is being generated.

I assume that the minify action should be performed while building the war file, at least that was the case with the old UI performance plugin that I was using before. There is very little log output while generating the war file and my log4j settings don't seem to apply during that process.  Do you have any hints about what might be causing this or how I could debug this?

Thanks in advance,

Carina
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: yui-minify-resources - no minified resources on production system

Marc Palmer Local

On 22 Nov 2011, at 14:30, carina wrote:

> Hi,
>
> I'm using the yui-minify-resources plugin with Grails 2.0.0.RC1 to compress
> the resources that I defined using the resources plugin. I use it in
> combination with zipped-resources and cached-resources and it works fine
> locally when I use prod run-war.
>
> *However, the minified resources are not used on the production system: the
> bundled resources are included instead of the minified ones. *When I try to
> open the URL of a minified resource manually, it is not available. The
> configuration on the production system is hardly any different from the
> local configuration and I did not find and warnings, error messages or
> related differences in the log file when running the application or while
> the war file is being generated.
>
> I assume that the minify action should be performed while building the war
> file, at least that was the case with the old UI performance plugin that I
> was using before. There is very little log output while generating the war
> file and my log4j settings don't seem to apply during that process.  Do you
> have any hints about what might be causing this or how I could debug this?
>
> Thanks in advance,
>
> Carina
>

Hi Carina,

Can you try Resources 1.1.3 and see if that makes a difference?

There was a bug in the Resources 1.1.x line where module dependencies were not calculated in production, and this may have been an oblique cause of the problem you are seeing.

Thanks
Marc

~ ~ ~
Marc Palmer
Freelancer (Grails/Groovy/Java)

Founder @ http://noticelocal.com | Developer @ http://weceem.org
Member @ http://spottymushroom.com | Contributor @ http://grails.org
Twitter: http://twitter.com/wangjammer5 | Resumé: http://www.anyware.co.uk/marc/
Blog: http://www.anyware.co.uk | Grails Rocks: http://www.grailsrocks.com


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: yui-minify-resources - no minified resources on production system

carina
Hi Marc,

sorry for the late reply. I'm still using Resouces 1.1.1 but everything works fine now. I think it had to do with an issue in our deployment process.

Thanks for your reply!

Carina
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: yui-minify-resources - no minified resources on production system

felipenasc
Hi

I am having the same problem.  

In dev yui-minify works well and my JS file are minified. But in production the files are not minifed.
My environment is grails 2.0.3, yui-minify 0.1.5, cached-resources 1.0.
I strongly use dependsOn in the declarations of my modules.

Tks
Felipe
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: yui-minify-resources - no minified resources on production system

martel9057
We get the same problem when redeploying our application to an instance of Tomcat. In order to get the minified resources to register, we have to delete the ${CATALINA_HOME}/work directory (where the resources are stored). This works, but isn't very desirable...
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: yui-minify-resources - no minified resources on production system

Marc Palmer Local

On 20 Aug 2012, at 21:58, martel9057 <[hidden email]> wrote:

> We get the same problem when redeploying our application to an instance of
> Tomcat. In order to get the minified resources to register, we have to
> delete the ${CATALINA_HOME}/work directory (where the resources are stored).
> This works, but isn't very desirable...
>
>


This could be the YUI minify plugin's mapper "optimising" or it could be Resources version you are using.

I know Resources checked for a copy of the file in the work dir and didn't overwrite it if already there in some circumstances, to prevent re-processing of all files unnecessarily. I don't believe it does this any more (i.e. 1.2-RC1).

Have a dig in the YUI minify code and/or turn on debug logging to see what is going on.

Marc

~ ~ ~
Marc Palmer
Freelancer (Grails/Groovy/Java/UX)

I offer commercial support for Grails plugins from as low as $50/mo.
For details see: http://grailsrocks.com

Blog: http://www.anyware.co.uk | Resumé: http://www.anyware.co.uk/marc
Contributor @ http://grails.org |  Founder @ http://noticelocal.com
Developer @ http://weceem.org | Member @ http://spottymushroom.com
Twitter: http://twitter.com/wangjammer5 


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: yui-minify-resources - no minified resources on production system

aprudnikovas
I can only confirm that yui-minify-resources does not minify code in production due to some reasons. Locally it works, then test environment works, but not production.

BUILD CONFIG:
runtime ":resources:1.2-RC1"
runtime ":yui-minify-resources:0.1.5"

CONFIG:
grails.resources.mappers.yuicssminify.includes = ['**/*.css']
grails.resources.mappers.yuijsminify.includes = ['**/*.js']
grails.resources.mappers.yuicssminify.excludes = ['**/*.min.css']
grails.resources.mappers.yuijsminify.excludes = ['**/*.min.js']
//Minify only, do not obfuscate javascript code
grails.resources.mappers.yuijsminify.js.noMunge = false
//Preserve all semicolons in javascript files
grails.resources.mappers.yuijsminify.js.preserveAllSemicolons = true
//Disable all micro optimizations in javascript files
grails.resources.mappers.yuijsminify.js.disableOptimizations = true

In development I get bundled resources. nothing breaks, just not minifying.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: yui-minify-resources - no minified resources on production system

tonytong
In reply to this post by carina
i find a free online tool to minify javascript.
Loading...