martedì 16 giugno 2009

What you need to develop FastCGIs: my favorite tools

Besides an environment for compiling and deploying applications (in my case an Ubuntu Server distribution) there are some other useful tools that can help the developer on writing code and debugging it.
Usually, I work on Windows (at the moment I'm trying Windows 7 RC) and I execute the server on a virtual machine in the same PC.
My favorite text editor is Notepad++: free, open, fast and with a lot of useful functions for developers. When I write CSS, HTML, PHP, JS or C code I can't live without it.
To upload files to the server there are 2 great FTP/SFTP clients: WinSCP and Filezilla and it's hard to decide which is the best.
The most difficult step on developing web applications is the debugging stage, in this case we could need HttpSpy, a simple application that can capture HTTP traffic (it works only with Internet Explorer, but not under Vista), if you prefer more sophisticated tools you can consider Fiddler (I prefer simplicity so I use HttpSpy, when possible).

Another must-have tool is the YUI Compressor that can minimize JavaScript and CSS code.

There are also a lot of fantastic plug-ins for web developers that can be installed on Firefox:

Firebug: it “allows the debugging, editing, and monitoring of any website's CSS, HTML, DOM, and JavaScript, and provides other Web development tools.” (Wikipedia)

CSSViewer: a simple CSS properties viewer

Dust-me Selectors: useful to find unused CSS selectors

Venkman JavaScript Debugger: nothing else …

Google Page Speed and Yahoo! YSlow: two tools for speed-up tuning of the web site

SEO for Firefox: a good support for SEO analysis

If you know other useful tools for web developers let me know, please.

martedì 2 giugno 2009

Sorry, but what are FastCGIs?

A friend of mine asked me this question, an easy answer is that they are faster CGIs! Obviously now the question is “What are CGIs?”.

When the web was emerging there was the need to serve not only static pages, but also pages created just in time. The first, primitive answer was the Server Side Include (SSI) technology, useful to accomplish easy tasks, but inadequate to develop complex pages and sites. A better solution was the Common Gateway Interface (CGI), a standard protocol for interfacing web servers with any stand-alone application able to write to the standard output. The web server acts as a gateway: it executes the application corresponding to the called URL and sends its standard output to requesting client (the browser) over the TCP/IP connection. So, thanks to CGI, every language capable of writing to the standard output, even bash scripts, could generate dynamic web pages (not only HTML pages, but also images, style files, etc.). As you can see, differently from current languages and environments for the web (PHP, ASP.NET, JSP, etc.), the programmer have to do a hard work: he has to generate the header of the HTTP answer and, in the case of a HTML page, to compile every tag.

The CGI approach to dynamic web pages has other disadvantages: some performance problems, a difficult access to HTTP’s parameters (GET/POST parameters, cookies and other header’s parameters) and the lack of a communication mechanism between application instances. FastCGI protocol try to overcome these limits.