Any way define sets of files ?

Jan 6, 2012 at 10:27 PM

Page load times are better with fewer requests. Is there a way to for example tell Combinator to minify and combine jQuery and my main .js file, because those two are used all over my site? And then let it treat the rest of the scripts on a page as a separate set that it optimizes as it already does now? 

 

Another scenario would be if I have many pages that have small amount of scripts, and the script sets differ only slightly. It would make sense to load all those tiny scripts as one set to minify and combine, even though all the similar pages that use them may not need all the files bundled in there. This way once a user visits one of these pages, all visits to other pages that use the same set should load bundled script from the cache. 

 

Hope this makes sense. Also, thank you for making this. 

Jan 6, 2012 at 10:51 PM

I'm glad you find the module useful and thanks for the feedback.

It could indeed be beneficial to have separate sets of resources as they can be better cached by the browser. Good idea. Actually it seems also not very hard to implement.

Could you please open an issue for this? (I've learned this sentence from the Orchard devs, and it's wonderful to write the first time :-).)

Jan 6, 2012 at 11:01 PM

OK. I'm not sure how other libraries are doing it, but there are two I know of (not sure if either will work with your Module; havent' looked at your code yet): 

1. How I did this in my project before I moved it into orchard: custom msbuild script to minify scripts and combine them. This is where I defined my "sets" of .js and .cs. In my pages, I used #if(DEBUG) { include individual files } #else { include specific minified & combined file }. This effectively hardcoded the "set" for each page. For most of my pages the set was the same so it wasn't a problem. 

 

2. I've seen a library that takes in a comma delimited set of files. You could do something similar but let the sets be defined on the fly in the code, or through the Orchard Dashboard; this would get around the problem of people potentially messing with the querystring param containing the comma delimited list of files to bundle. 

 

I will file the ticket and make a reference to this post so I won't have to type too much again. 

 

Thanks again!

Jan 6, 2012 at 11:08 PM

Issue created: http://combinator.codeplex.com/workitem/23 

Jan 6, 2012 at 11:36 PM

Thanks, follow-up there.