Wednesday, July 03, 2013

ColdFusion 10 WebSockets Gotcha's and Hair Pulling Fixes

Well I finally can say I am a bit more comfortable using the WebSockets technology offered by ColdFusion 10 but below is a checklist of things to make sure you have completed in order to allow for them to work properly.
  1. Firewall Requirements
    If you have a firewall you have to open up the following default ports or which ever you change to:
    • 8575 Default for WebSocket Server - you can edit this in the CF Admin
    • 1243 Default for Flash fall back - flashPolicyPort (if you care about IE 9 and before) - you can edit this in  <cf_home>/ColdFusion10/cfusion/lib/neo-websocket.xml
       
  2. Directory to SWF for Flash Fall Back
    A little gotcha on the Flash fall back. If you allow this and IE tries to access this and you have changed the default path to your scripts directory which is recommended, it fails because the SWF is always requested from /CFIDE/ ... so you need to still map this directory. If you do, I say create the CFIDE inside your site and then map the scripts directory directly inside rather than opening the entire directory  Good thing about 10 is you can just map the directory and block access to the admin by IP. Also on IIS 7 you can restrict access to /CFIDE/administrator and any other directory you want my using Request Filtering.

    This is referenced in the /CFIDE/scripts/ajax/package/cfWebSocketMain.swf file lines 1069 and 1070.

    The fix is as stated above (map CFIDE) or edit the file and change the path to reflect your new path you set in the admin but that requires you to remember that in case there is an update to these files and it gets overwritten.
     
  3. IE and SSL connections
    So IE10 will not connect to your web socket if being requested from an HTTPS site. Currently it is not supported but in the works as specified here:

    http://stackoverflow.com/questions/10957468/does-cf10-support-secure-websocket-wss/17454026#17454026

    You can see in post above the hack I tired but no luck connecting to wss:// even if I forced it. So for now if you need to support IE, you must make the page initiating the call a regular non-secure page. 

Wednesday, May 01, 2013

Optimize the static resources of your webapps or webpages

Well first off it appears I am a bit behind on the news, but last October Google released the final version of mod_pagespeed, which is an apache module that automatically optimizes the static resources of your applications or webpages. This sounds great and I will definitely play with it today on my mac which is what I do most of my development on and how I've gotten better at running apache.

Now how about IIS? Well, I do host my production sites/apps on IIS 7.5 and for most of my projects I normally include Microsoft's Web Optimization which can be easily installed thru NuGet on your VS projects but if you don't use that, ask a friend to hand you over the DLL's to place in your bin folder and with some simple rules in your Global.asax you can bundle and minify your CSS and JavaScript files. I do normally develop using ColdFusion and this ends up being a learning curve for some people I've worked with as I introduce them into using .NET in this manner. Now, I feel that it is ok to mix up technology, because it helps you learn new things and make you better as well as get the job done right (but that is my opinion). Well, I learned about Google's release because today I learned about IISpeed, which is a port of the original Apache module  which has been adapted to work with IIS, so we now have all its features available and free of charge :-)

Both mod_pagespeed and IISpeed gives you the following:
  • Minimization, rewriting and combination of JavaScript and CSS files.
  • Image optimization-images are resized before they are sent if the HTML displays them with a smaller size; their format is changed to send the most appropriate one without quality loss; and unnecessary headers (which can take up a lot of space) are eliminated.
  • Conversion of image sets to Sprites to reduce the number of requests.
  • Elimination of comments in HTML files.
  • Cache optimization.
  • Optimization testing via A/B tests.
These truly sounds great and I will try to find some time to play with both and deploy and I recommend you do the same.

Apache users can learn more about mod_pagespeed at:
https://developers.google.com/speed/docs/mod_pagespeed/filters

IIS users can learn more about iisspeed and Web Optimization in the following urls:
http://aspnetoptimization.codeplex.com/
http://www.iispeed.com/

Wednesday, February 27, 2013

ColdFusion 10 Update 8 Released

The latest update for ColdFusion is out, which now makes CF certified on the JDK 1.7 Update 15 as well as Mac support on Mountain Lion 10.8.2. It also updates the Google Maps API from v2 to v3. If you use that feature and update make sure to check your API key as v2 API keys will no longer work.

For more info, go to the following link.

http://helpx.adobe.com/coldfusion/kb/coldfusion-10-update-8.html

The JDK Update is also available for ColdFusion 9 in 3 different hot fixes, one for 9, 9.0.1 and 9.0.2 so make sure to know which version you are running.

Tuesday, February 26, 2013

IE 10 Released for Windows 7

Glad to hear that this has finally been released and even happier to read that all W7 machines will get automatically upgraded in the next coming weeks to months, though I wish it was just done today!!!!

You can read more at Scott Hanselman's blog (great speaker by the way)!
http://www.hanselman.com/blog/RELEASEDDownloadInternetExplorer10ForWindows7.aspx

Here is the post on IE's blog
http://blogs.msdn.com/b/ie/archive/2013/02/26/ie10-for-windows-7-globally-available-for-consumers-and-businesses.aspx

And in case the download link is not working for you, here is a working one provided by Scott.
http://windows.microsoft.com/en-us/internet-explorer/downloads/ie-10/worldwide-languages