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

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

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?

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

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.

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

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.

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

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...

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

> 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.