I heart Rack Middleware

This Scaling Rails episode led me to the Rack Contrib project on GitHub. This project contains some pretty neat middleware that can be a huge time-saver in developing Rails apps. I am going to use some of these for sure.

Middleware I am very interested in:

Rack::Locale – Detects the client locale using the Accept-Language request header and sets a rack.locale variable in the environment.

Rack::Sendfile – Enables X-Sendfile support for bodies that can be served from file.

Rack::TimeZone – Detects the clients timezone using JavaScript and sets a variable in Rack’s environment with the offset from UTC. (wow!)

Rack::Backstage – Returns content of specified file if it exists, which makes it convenient for putting up maintenance pages. (no more rewrite rules to maintain)

Rack::Access – Limit access based on IP address.

About joost

Senior Ruby on Rails web developer, with a focus on content and media management. I have built, and continue to maintain, some of the busiest sites in The Netherlands. I strongly advocate a pleasant and concise user experience, agile development, web standards and open source software.