Helper class for performing minification of Javascript and CSS.
This class is basically a wrapper for the AjaxMin library(lib/AjaxMin.dll). http://ajaxmin.codeplex.com/ There are no symbols that come with the AjaxMin dll, so this class gives a bit of intellisense help for basic control. AjaxMin is a pretty dense library with lots of different settings, so everyone's encouraged to use it directly if they want to.
        private static string RetrieveRemoteFile(string file)
        {
            file = Utils.AbsoluteWebRoot.ToString() + file.Substring(1);
            Uri url;

            if (Uri.TryCreate(file, UriKind.Absolute, out url))
            {
                try
                {
                    var script = new RemoteFile(url, false).GetFileAsString();

                    if (BlogSettings.Instance.CompressWebResource)
                    {
                        var min = new JavascriptMinifier();
                        return(min.Minify(script));
                    }

                    return(script);
                }
                catch (SocketException)
                {
                    // The remote site is currently down. Try again next time.
                }
            }
            return(string.Empty);
        }
 private static string RetrieveRemoteFile(string file)
 {
     file = Utils.AbsoluteWebRoot.ToString() + file.Substring(1); 
     Uri url;
     if (Uri.TryCreate(file, UriKind.Absolute, out url))
     {
         try
         {
             var script = new RemoteFile(url, false).GetFileAsString();
             
             if (BlogSettings.Instance.CompressWebResource)
             {
                 var min = new JavascriptMinifier();
                 return min.Minify(script);
             }
             
             return script;
         }
         catch (SocketException)
         {
             // The remote site is currently down. Try again next time.
         }
     }
     return string.Empty;
 }