Archive

Archive for the ‘HTTP’ Category

NGINX Service for Windows

November 14th, 2011 No comments

Recently I had use for NGINX on Windows, if you don’t know what that is then check out articles here and here. Thankfully there was a Windows build available and I got that up and running nominally in no time.

However, sadly as per usual with a lot of stuff coming from UNIX, support for the way Windows does things such as services was non existent, so I had to put my programming skills to use and have made a little Windows service wrapper for it. I’m providing binaries and source free in the hope that others may find this useful, you can download them here or you can find them on my Github.

It was wrote using Visual Studio 2010 and targets the .NET 2.0 framework, which does mean you need .NET installed, but that’s pretty much a given on most modern installs of Windows thesedays.

nginx-svc-bin.zip
5 KB
nginx-svc-src.zip
16 KB
Categories: Caching, Github, HTTP, NGINX, Web Development, Windows Tags:

Articles in JSMag!

May 12th, 2010 No comments

Just to announce although a bit late for April, but I’ve recently wrote two articles for JSMag. I highly recommend JSMag to any JavaScript developers who may be reading this.

My first article in April details with using on-demand JavaScript loaded with ExtJS – http://www.jsmag.com/main.issues.description/id=31/

The second article, for May details implementing client-side caching of JavaScript – http://www.jsmag.com/main.issues.description/id=32/

Taking control of your Ext AJAX requests

February 16th, 2009 No comments

With Ext if you do not specify the HTTP request type then it will attempt to make this decision for you, the Ext documentation says that if the request has no parameters it will use GET otherwise it will use POST. When you’re starting out this is fine but later on you will soon find you want to change this, especially in relation to optimization, POST is a more expensive version than GET and GET is cachable.

You can easily adapt a standard Ext.Ajax request by specifying the request method like this:

Ext.Ajax.request({
	method: "GET",
	url: "http://www.example.com/",
	...
});

Simple. The above code is nice for plain AJAX requests however for Ext.data.Store requests things are a little trickier, for that you need to specify a new proxy in the config for the store to use:

var store: new Ext.data.Store({
	autoLoad: false,
	proxy: new Ext.data.HttpProxy({
		method: "GET",
		url: "http://www.example.com/timezones.php"
	}),
	reader: new Ext.data.JsonReader(
		{root: "list", totalProperty: "count"},
		[{name: "timezone_id", type: "int"},{name: "timezone_name", type: "string"}]
	)
});

Wouldn’t the store request using GET anyhow you ask? Yes it would. However, here comes the crunch, what if you added params? This is especially so when using for example the paging toolbar which passes it’s information as such.

Hopefully this will help you in your quest to write better web applications.

Note: There is a slight caveat to using GET over POST and that is because GET makes all the params part of the URL so anything that restricts URL length will not like obscenely long lists of params. In the naming and shaming game I single IE out here.

Categories: AJAX, ExtJS, HTTP, JavaScript, Web Development Tags: