Quick Nav:  Online Store   |   Login | Register

Static File Handler Needed for Merging of JS?

Rate this topic:

Please Register to post a reply. Another benefit of registration is the ability to subscribe to and recieve notifications of new posts.
AuthorMessages
Stephen Park
<20 Posts
Posts:7


05/02/2008 3:34 PM  

Hi

I had a question about the merging of JS. 

If I undertsand it correctly PB should allow merging all js into a single file for one round-trip to the server? I have I think enabled all the necessary switches in the pageblaster.config file, yet inspecting  the output from the server still shows discrete dnn.*.js files in the head of the document. Do I need to enable static file handling for this to work (I have not done this yet)? Attached is my working config file.


Attachment: 152344891371.txt

John Mitchell
Posts:2779


05/02/2008 4:45 PM  

Hi Stephen,

 No you don't need the Static File Handler, but PageBlaster will only merge CSS and JS files that are in the head section because merging the others may cause problems if the way the site is displayed.

The replacement rules that you enabled for the DNN JS files move some of the DNN JS to the head so that they will be merged.

You could create more rules like that if you wanted to move and merge in more css & js links from the middle of the page.

Stephen Park
<20 Posts
Posts:7


05/02/2008 4:56 PM  
Ok I see. In looking at the output from my page, the head element is still showing a bunch of separate .js files:

[script removed] I was expecting to see a single file in the head?
Stephen Park
<20 Posts
Posts:7


05/02/2008 4:58 PM  

Whoops Javascript got stripped. You can see the site in question here.

Stephen Park
<20 Posts
Posts:7


05/03/2008 8:38 PM  

Digging a bit deeper I see that the cache folder does contain .axd files with compressed scripts. Similar for the css folder under cache, a single merged stylesheet. Setting trace level to debug I see it looks like CSS excludes are happening:

5/3/2008 7:36:44 PM PB:RequestController:IsRequestExcluded: Request Is Excluded:
    Path=/DesktopModules/BestWebSitesSeoSocialBookmarks/module.css
    ExcludeFrom=CSSMerge    ExcludePattern=(DesktopModules(?!/Snapsis/PageBlaster)|/admin/|/host/|LinkClick|SiteMap|rss|captcha|install|thumb|\.ashx|\.asmx)
5/3/2008 7:36:44 PM PB:RequestFilter.MergeCSS: Excluded Merge of CSS File: /DesktopModules/BestWebSitesSeoSocialBookmarks/module.css
5/3/2008 7:36:44 PM PB:RequestFilter.MergeCSS: Excluded Merge of CSS File: /DesktopModules/SimpleGallery/module.css
5/3/2008 7:36:44 PM PB:RequestFilter.MergeCSS: Excluded Merge of CSS File: /Portals/_default/default.css
5/3/2008 7:36:44 PM PB:RequestFilter.MergeCSS: Excluded Merge of CSS File: /Portals/_default/Skins/skins/skin.css
5/3/2008 7:36:44 PM PB:RequestFilter.MergeCSS: Excluded Merge of CSS File: /Portals/0/Containers/containers/container.css
5/3/2008 7:36:44 PM PB:RequestFilter.MergeCSS: Excluded Merge of CSS File: /Portals/0/portal.css
5/3/2008 7:36:44 PM PB:Compression: Compressing content: Encoding=gzip, Ratio=80.1%
5/3/2008 7:36:44 PM PB:RequestController:UpdateRequestCache: Request added to Disk Cache:

Does anyone have any thoughts?

 

John Mitchell
Posts:2779


05/04/2008 11:23 AM  

Oh right.  It is this part that is excluding the css files from being Merged.  DesktopModules(?!/Snapsis/PageBlaster)

That is saying to exclude everything in the DesktopModules folder.

That exclusion is pretty broad, but I put it in there to keep people from having problems with other modules.

I'd recommend removing it, and then adding back in more specific excludes on other modules that have problems.

I'm working a new version that better handles exclusions automatically. If you want to give it a try I have attached it to this post.

You'll still want to take out the exclusion I bolded above, but you will also be able to remove several other exclusions like LinkClick, SiteMap, & thumbnail generators.


Attachment: 154233618571.zip

Stephen Park
<20 Posts
Posts:7


05/05/2008 10:49 AM  

Thanks for looking into this.

I applied the new dll you attached and modified my exclusion rules. I made some progress in that now the CSS are being merged and moved to the head of the document. This helped the performance. I am still in a bit of a pickle about the js though.

Currently I have dnn.xmlhttp.js, dnncore.js, dnn.xml.js, dnn.controls.dnntree.js showing up in the head, and dnn.js right after the __doPostBack function. There is no merged js anywhere in the document (.axd). I tried to create my own exclusion rule to remove the dnncore.js file and replace it with a comment, but the engine seems to have ignored the rule.

If I can get the js issue resolved I will be where I need to be wrt performance on the site. Attaching my current config file. If you have a known-good "lean-and-mean" config (mege js and css) file you can send me to try out I'm willing to give it a whirl.


Attachment: 155492959071.zip

John Mitchell
Posts:2779


05/05/2008 11:13 AM  

Hi Stephen,

Your config file is more "lean" than the one I have currently in debug, but you can try the one I have attached.

I don't understand why it would skip over meging of the JS since it is doing the move rules.

Could you turn the tracing back on and look for MergeJS entries?

 

That is really encourging that your site is running without hardly any excludes, even with those images coming from an .ashx handler.


Attachment: 155134763754.zip

Stephen Park
<20 Posts
Posts:7


05/05/2008 3:58 PM  

Here is some data from the log:

PB:RequestFilter.MergeJS: Starting Merge of JS File: C:\ANGELZFUNNYZ\Website\js\dnncore.js
PB:RequestController:IsExcludedFrom: Request Is Excluded:
 Path=C:\ANGELZFUNNYZ\Website\js\dnncore.js
 ExcludeFrom=Replacements ExcludePattern=\.js$|\.css$|\.html$
PB:RequestFilter.MergeJS: Completed Merge of JS File: C:\ANGELZFUNNYZ\Website\js\dnncore.js
PB:Compression: Compressing content: Encoding=gzip, Ratio=77.9%
PB:RequestController:UpdateRequestCache: Request added to Disk Cache:

 

Is it possible this line is causing the merge to be skipped?

          

I tried removing it from the configuration but it didn't change the behaviour. Also doesn't explain why the .CSS files are being merged correctly. I do see the merged .js files in the snapsis cache but they' re note making it into the output document from the site.

John Mitchell
Posts:2779


05/05/2008 5:25 PM  
That looks normal except you should be seeing more entries for the other JS files. Are those entries in order?

What happens if you add this as an excludePath?

path pattern="\.js" excludeFrom="JSMin" />
Stephen Park
<20 Posts
Posts:7


05/05/2008 8:35 PM  

On the last trace there were some previous entries but they were spaced by several (4 or 5) web requests. Unfortunately my test site is fairly active.  Here is a more complete trace with the new path rule you asked me to add:

 

PB:RequestFilter.MergeCSS: Starting Merge of CSS File: C:\ANGELZFUNNYZ\Website\DesktopModules\BestWebSitesSeoSocialBookmarks\module.css
PB:RequestController:IsExcludedFrom: Request Is Excluded:
    Path=C:\ANGELZFUNNYZ\Website\DesktopModules\BestWebSitesSeoSocialBookmarks\module.css
    ExcludeFrom=Replacements    ExcludePattern=\.js$|\.css$|\.html$
PB:RequestFilter.MergeCSS: Completed Merge of CSS File: C:\ANGELZFUNNYZ\Website\DesktopModules\BestWebSitesSeoSocialBookmarks\module.css
PB:RequestFilter.MergeCSS: Starting Merge of CSS File: C:\ANGELZFUNNYZ\Website\DesktopModules\SimpleGallery\module.css
PB:RequestFilter.MergeCSS: Completed Merge of CSS File: C:\ANGELZFUNNYZ\Website\DesktopModules\SimpleGallery\module.css
PB:RequestFilter.MergeCSS: Starting Merge of CSS File: C:\ANGELZFUNNYZ\Website\Portals\_default\default.css
PB:RequestFilter.MergeCSS: Completed Merge of CSS File: C:\ANGELZFUNNYZ\Website\Portals\_default\default.css
PB:RequestFilter.MergeCSS: Starting Merge of CSS File: C:\ANGELZFUNNYZ\Website\Portals\_default\Skins\skins\skin.css
PB:RequestFilter.MergeCSS: Completed Merge of CSS File: C:\ANGELZFUNNYZ\Website\Portals\_default\Skins\skins\skin.css
PB:RequestFilter.MergeCSS: Starting Merge of CSS File: C:\ANGELZFUNNYZ\Website\Portals\0\Containers\containers\container.css
PB:RequestFilter.MergeCSS: Completed Merge of CSS File: C:\ANGELZFUNNYZ\Website\Portals\0\Containers\containers\container.css
PB:RequestFilter.MergeCSS: Starting Merge of CSS File: C:\ANGELZFUNNYZ\Website\Portals\0\portal.css
PB:RequestFilter.MergeCSS: Completed Merge of CSS File: C:\ANGELZFUNNYZ\Website\Portals\0\portal.css
PB:FolderCleanup.CleanFolders: Folder clean complete:
    Cache Folder=C:\ANGELZFUNNYZ\Website\DesktopModules\Snapsis\PageBlaster\Cache\JS
    Files Cached=0, Files Removed=0, MBytes Removed=0
PB:RequestFilter.MergeJS: Starting Merge of JS File: C:\ANGELZFUNNYZ\Website\js\dnncore.js
PB:RequestController:IsExcludedFrom: Request Is Excluded:
    Path=C:\ANGELZFUNNYZ\Website\js\dnncore.js
    ExcludeFrom=JSMin    ExcludePattern=\.js
PB:RequestFilter.MergeJS: Completed Merge of JS File: C:\ANGELZFUNNYZ\Website\js\dnncore.js
PB:Compression: Compressing content: Encoding=gzip, Ratio=80.5%
PB:RequestController:UpdateRequestCache: Request added to Disk Cache:
    Size=35532

 

In the output document, I am seeing some more progress. A single dnn.js file in the document body and a .js.axd at the end of the document. Something important to note: The output document differs by browser type. Testing in firefox I see only the single .js file and the .axd, whereas in IE7 I see all the dnn.*.js files at the top of the document. Even with FF, some tabs have all the .js files embedded whereas others have only the single .js file and the merged .js.axd that PB produces. I should have mentioned this is on PB 3.2.0 with the .dll you attached to this thread.

 

 

 

 

Please Register to post a reply. Another benefit of registration is the ability to subscribe to and recieve notifications of new posts.
Forums >Snapsis Product Support >PageBlaster > Static File Handler Needed for Merging of JS?



ActiveForums 3.7
Powered by: Snapsis Software