Save RAM with mobile middleware
Wednesday, October 7, 2009
A while back I wrote an article on how to set up a mobile site with Django ../going-mobile. Currently I have a Slicehost account which includes 256MB of RAM. My resources are tight and I really dislike having another set of unnecessary Apache processes for a mobile site that, aside from different templates, is using the same code base. The solution is quite simple, write a middleware. The following code checks the incoming request for ’m' or ‘mobile’ in the domain name.