Forum


HomeHomePremiumPremiumAdministrationAdministrationMinify and Composite JS/CSS filesMinify and Composite JS/CSS files
Previous
 
Next
New Post
9/11/2019 3:53 AM
 
Hi Aderson,

I was just looking at your video on composite files and minification
https://www.youtube.com/watch?v=06teoPwdW8E

I can see that CSS and JS files can be both minified and set to create composite files, I assume the later means the JS files and CSS files are concatenated into two separate files to reduce the number of file for download.


But under the server settings on the performance tab it says:
"Important note regarding minification settings.
If minification settings are changed when composite files are enabled, you must first save the minification settings by clicking Save and then increment the version number. This will issue new composite files using the new minification settings."

I assume I can initially enable composite files as well as enabling CSS and JS minification and then click 'save'.
If I ever wanted to switch minification off and leave composite files enabled, I'd need to:
o Disable 'Minify CSS' and/or 'Minify JS'
o Hit Save
o Click the 'Increment Version' button whilst leaving 

I assume I would need to repeat this procedure if the CSS or JS is changed?
Though, I can't imagine needing changing those files myself.

Would this need to be done if the site was upgraded to a later DNN version?

Is it possible and if so would it be good practice to minify and composite a custom module's JS and CSS files in the same way?

For example by putting those files in a subdirectory under DNN's JS and CSS files (where ever they may be).

Best Regards,

Steve

 
New Post
9/12/2019 3:51 AM
 
Hi Steve,

To your questions:

1 - The process you have listed is correct. Eventually the minified and composited versions would get regenerated but if you want to see immediate changes after changing a CSS or JS file you would need to increment the version number.

2 - When a site gets upgraded it runs a new minification and composition.

3 - If you are using the "DNN way" of adding a CSS and JS file to your module, you don't need to minify nor composite. DNN will that that for you. For that you need to be using DNNJSINCLUDE AND DNNCSSINCLUDE - More info at: https://www.dnnsoftware.com/wiki/client-resource-management-api

Cheers,
Aderson
 
New Post
9/12/2019 10:26 AM
 
Hi Aderson,

Thank you for your reply.

1 - That would give me a problem as the app I've created allows JS and CSS to be added and changed and can potentially change quite often. I don't want to go through the rigmarole of incrementing the version every time I make a change. Possibly I could add those two files separately in a non-DNN way. That would mean the vast majority of CSS and JS files could be minified and combined to form composite files, all except for the two my app creates.


2 - That's good to know.

3 I'm using:
  ClientResourceManager.RegisterScript
  & ClientResourceManager.RegisterStyleSheet

 I assume they would have the same effect. The issue is that I'm adding the files dynamically, i.e. if they're present under a given directories they're registered. That's very handy but I think I'd have to introduce a step to concatenate them and then add the 2 concatenated JS and CSS files using RegisterScript and RegisterStyleSheet. 

It all needs a  bit of thinking about.


I hope that all makes sense.

Before I do anything, I will try enabling these performance options to see what kind of difference they make.

Best Regards,

Steve
 
New Post
9/14/2019 8:42 AM
 

Hi Steve,

I haven't tested that extensively to talk proficiently about that when it comes to custom CSS and JS files that a module allows user to upload. I think the best approach is just to test with the composite option and see how it behaves.

Feel free to share your results here again Steve.

Thank you,

Aderson

 
New Post
9/17/2019 12:00 AM
 

Hi Aderson,

Sure, I will report back my findings.

Thank you.

Steve

 
Previous
 
Next
HomeHomePremiumPremiumAdministrationAdministrationMinify and Composite JS/CSS filesMinify and Composite JS/CSS files



Try FREE
30 days money back guaranteed