Pages

What Programming Language Should I Use to Build a Startup?

Often entrepreneurs ask me 'What technology should I build my startup on?' There is no right or wrong answer to this question. It's a decision every company makes for itself, depending on what it's trying to build and the skills of its cofounders. Nonetheless, there are a few rules that one should adhere to. We discuss them in this blog post.

Incident Response Policy

What happens in your company when a production incident occurs? Usually in a typical startup, you will see engineers running around frantically trying to resolve the problem. However, as soon as the incident is resolved, they forget about it and go back to their usual business. A good incident response policy can help bring order into chaos. We provide a sample template in this blog post.

Why Software Deadlines Never Make Sense

We discuss why software deadlines usually don't make sense.

Analyzing Front-End Performance With Just a Browser

We discuss a number of freely available online tools which can be used to analyze bottlenecks in your website.

Why Smaller Businesses Can't Ignore Security and How They Can Achieve It On a Budget

In this article, we show that security is both important and achievable for smaller companies without breaking a bank.

Sunday, September 30, 2012

Impact of page load time on conversions


A nice chart from Kissmetrics about the impact of web page load time on profits.

Wednesday, September 26, 2012

Success

Tuesday, September 18, 2012

Cinchcast Introduces an Innovative Solution for Virtual Events, Webcasts, and Conference Needs

Wednesday, September 12, 2012

Even the small bytes matter


Great post by Cinchcast engineer Enrique Alegretta about how we implemented a framework to minify HTML and inline Javascripts on our Blogtalkradio webpages.
This is cross-referenced from our Tech blog http://tech.cinchcast.com 

Even the small bytes matter
Here at Cinchcast we found ourselves thinking about different ways we could reduce ourbandwidth usage. Since BlogTalkRadio has aconsiderable user base, we use a lotof bandwidth in our efforts to provide an enjoyable user experience.
One of the techniques we use to facilitate faster page loads is enabling gzip, this is a common practice and will save lots of bytes simply by compressing the response output. Since we want to continually evolve and have a great infrastructure we continued to look for more ways to improve response times and page load speed. One particular technique we are using (and the main reason of this blog post) is removing whitespace and minifying inline css and inline javascript (we’re currently minifying external css and js files thanks to the excellent YUI compressor).
Since we’re developers at heart anddon’t like to reinvent the wheel unless we plan on learning more about wheelswe asked ourselves: is there anything out there already that we could use or at least useas a base for our implementation? The answer was yes and was located at this codeplex project.

Enter WebOptimizer

WebOptimizer.NET is a set of http modules you can add to your website for whitespace removal, inline javascript minification and inline css minification among other things. It’s a great project but since its open source what we did instead of using it as is was to take the pieces we wanted and build our own solution (because we like to learn more about wheels XD). This effort lead to the birth of the Cinchcast Framework, a common set of tools and functionality which will be shared among the Cinchcast and Blog Talk Radio applications.

The Cinchcast Web Framework

We ended up digging through WebOptimizer and took the pieces we needed and performed some changes to it. One key class we took and changed was theBaseFilterStream class. This is an abstract class that provides the base functionality to create FilterStreams which will be assigned to the Response.Filter property in order to properly modify the response. One of the changes we did was to modify its constructor in order to have the following:
/// 
/// Initializes a new instance of the  class.
/// 
/// The context.
protected BaseFilterStream(HttpContextBase context)
{
      if (context == null)
            throw new ArgumentNullException("context", "The context cannot be null");

      HttpContext = context;
      Sink = context.Response.Filter;
}

/// 
/// Initializes a new instance of the  class.
/// 
/// The context.
/// The previous stream.
protected BaseFilterStream(HttpContextBase context, Stream previousStream)
{
      HttpContext = context;
      Sink = previousStream;
}

/// 
/// Gets the HTTP context.
/// 
/// 
/// The HTTP context.
/// 
protected HttpContextBase HttpContext
{
      get;  
      private set;
}
The reasons for doing this are two fold:
  1. We wanted to have the HttpContext available to all the classes which inherit from this class, we’re using HttpContextBase abstraction in order to be able to mock it during our unit tests.
  2. We wanted to provide stream chainability to perform several chained actions over the Response output. This is why one constructor has a reference to the previous stream. Every time the Write method is called, all the actions are performed and a call to Sink.Write is made, by using the previousStream what we’re doing is just calling another filter stream Write method which will perform its glorious magic.
We did reuse the RemoveWhiteSpaceFilterStream, MinifyInlineStylesFilterStream and MinifyInlineJavascriptFilterStream, but instead of using the tools for minification the WebOptimizer provided, we used Microsoft’s AjaxMinLib for CSS minification and the JSCompressor class from this codeproject article.

Cleaning up the response

We took our base foundation classes to get a Response.Filter, twisted it to make it show what we want, then wrapped this up into an HttpModulewe named…. yeah, you guess it, CleanHttpResponseModule or CHRM (pronounced charm).
Adding this module to the website automatically performs whitespace removal, inline javascriptminification and inline cssminification, but since we need to debug stuff and if you spent too much time debugging something that is minified you’ll end up as Crazy Dave from PvZ we gave the module the ability to deactivate any of those features. You can change this behavior on a page by page basis (using the queryString) or to the entire application using the appSettings section.

Conclusion and results

Using this module to its full potential (minifies js, css and removing whitespaces) allows us to save something between 2KB to 5KB per request, but since our requests are inthe millions take that value and multiply it and in the end the gains will be significant.
This is why even the small bytes matter.

Saturday, September 1, 2012

ROQUE : the simplest way to do asynchronous queuing and events in .NET

I am excited to announce that Benjamin Eidelman from the Cinchcast Tech team open-sourced ROQUE : the simplest way to do asynchronous events and queuing in .NET.
You can read more details about it at GITHUB page: https://github.com/benjamine/Roque


ROQUE sits on top of the C# abstractions you know (plain old C# events and methods), and uses Redis behind the scenes to make them work in an asynchronous, transparent, distributed, scalable, decoupled and failure-proof way.
Message queueing doesn't get simpler than this!
Lets say we have a website and we want to build thumbnails for uploaded pics, that's a time-consuming operation we can't perform during the lifetime of web request.
1- Create a service interface.
    public interface IImageProcessor {
        void CreateThumbnail(string filename, int width, int height, AlgorithmOptions options);
    }
2- Use it on your application:
    public class ImageBiz {
        IImageProcessor ImageProcessor = RoqueProxyGenerator.Create<IImageProcessor>("images");
        public void ImageUploaded(filename){
            ImageProcessor.CreateThumbnail(filename, 160, 120, new AlgorithmOptions { Quality=0.7 });
        }
    }
Note: add references to Roque.Core and Roque.Redis assemblies to your project.
3- Config a redis-based queue named "images":



That's it you are already enqueuing jobs!

4- Implement your image processor service:
    public class ImageProcessor : IImageProcessor {
        public void CreateThumbnail(string filename, int width, int height, AlgorithmOptions options = null){
            // a time-consuming task, eg: resize the image and save it adding a suffix
            throw new NotImplementedException();
        }
    }
5- Install Roque service on a machine (with access to your Redis server).
6- On the same folder of roque.exe drop the assembly(ies) containing IImageProcessor interface and ImageProcessor class.
7- On the worker Roque.exe.config:



8 - Start Roque service to start processing images!
(or you can roque.exe from a console, use: roque.exe /debug to attach your VisualStudio and debug your image processor)
You're done, now you can start adding more workers to get automatic load balancing by repeating steps 5 to 8.
To check the status of your queues you can run: roque.exe status
C:\>roque status /maxage=10 /maxlength=500000
Redis send-pump is starting
roque Information: 0 : [REDIS] connected to localhost:6379
Queue images has 262570 pending jobs. Next job was created < 1sec ago.
Queue audiofiles has 3342 pending jobs. Next job was created 12sec ago. [TOO OLD]
Queue zipping is empty.
ERROR: 1 queue have too old pending jobs