Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Javascript minifying is working only in first web load (just after assets folder is deleted) #42

Open
dantart opened this issue Sep 28, 2017 · 3 comments

Comments

@dantart
Copy link

dantart commented Sep 28, 2017

Hi:
Weird behaviour. I have this config:

            'class' => '\skeeks\yii2\assetsAuto\AssetsAutoCompressComponent',
            'enabled' => true,
            'readFileTimeout' => 3000, //Time in seconds for reading each asset file
            
            'cssCompress' =>                    true, //Enable minification css in html code
            'cssFileCompile' =>                 true, //Turning association css files
            'cssFileRemouteCompile' =>          true, //Trying to get css files to which the specified path as the remote file, skchat him to her.
            'cssFileCompress' =>                false,  //Enable compression and processing before being stored in the css file
            'cssFileBottom' =>                  true, //Moving down the page css files
            'cssFileBottomLoadOnJs' =>          true, //Transfer css file down the page and uploading them using js
                
            'jsCompress' =>                     true, //Enable minification js in html code
            'jsCompressFlaggedComments' =>      true, //Cut comments during processing js
            'jsFileCompile' =>                  true, //Turning association js files
            'jsFileRemouteCompile' =>           true, //Trying to get a js files to which the specified path as the remote file, skchat him to her.
            'jsFileCompress' =>                 false, //Enable compression and processing js before saving a file
            'jsFileCompressFlaggedComments' =>  false, //Cut comments during processing js
            
            'htmlCompress' => true, //Enable compression html
            'htmlCompressOptions' => //options for compressing output result
            [
                'extra' => true, //use more compact algorithm
                'no-comments' => true, //cut all the html comments
            ],
  1. I start the test deleting my assets folder
  2. I load the page and I see that js-compress files are created and in the source code I see just one call to a big js (minified of all my original js)
  3. I reload the page and then I see my dozens of js loaded as minified would have not worked
  4. Just if I delete again the assets folder, then the minified version is created correctly

So, it's just working JUST AFTER deleting the assets folder ... if there's something already created in the folder, it will not minified.

I have tried with other configuration, even turning everything off and just turn on the jsCompress. Same behaviour

Thank you for any help!

@rankovic
Copy link

rankovic commented Nov 22, 2017

I have exactly the same problem

@dantart did you found any solution?

@skeeks-semenov
Copy link
Owner

skeeks-semenov commented Nov 22, 2017

Try to configure in your project:

'components' => [
    'assetManager' => [
        'appendTimestamp' => true,
    ]
]

@rankovic
Copy link

Thanks for your quick reply... That didn't help, I'm using old version and had to change few lines in AssetsAutoCompressComponent.php

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants