November 2008
2 posts
1 tag
Custom Error Pages With Nginx and Thin
If you are using Nginx to proxy to another web server such as Thin or Mongrel, chances are you have had trouble getting your custom error pages to return the correct status codes.
If your application redirects to a cached error page Nginx will serve it as a normal file and will (correctly) tell the browser that everything was successful. Not quite the intended behaviour.
To fix this, add...
1 tag
Memoization In Javascript
function memoize(f) {
return function () {
var args = Array.prototype.slice.call(arguments);
f.memoized = f.memoized || {};
return (args in f.memoized) ?
f.memoized[args] :
f.memoized[args] = f.apply(this, args);
};
}
http://blog.thejit.org/