I’ve just finished working on the initial release of OpenLBS. OpenLBS is an open source suite of location based software. The two initial components of the project are the client and the server. The server is Pylons-based project that implements the OpenLBS HTTP Specs. The client implements those same specs to work with the server.
OpenLBS is useful if you want to run your own tracking server, or if you want to customize it according to your needs.
You can now add a Facebook application to your profile that will show your current location in a profile box.
For more information, visit http://blackberrytracker.com/facebook.
This middleware will use the W3 Validator Service to check if your page is valid HTML. It will only check each URI once so that it doesn’t slow down your site by validating every page load. It does this by placing the result of each URI into a memory cache(using Beaker). You can then call cache_is_valid_xhtml() in your template to determine if the current page is valid.
Note: The first time your page loads it will not display if the page is valid or not(It is validated AFTER the first response).
Source Download(gzipped): http://www.tech9computers.com/w3validator.tar.gz
At the top of your middleware.py import the following
Then right below CUSTOM MIDDLEWARE HERE
At the top you need to import cache_is_valid_xhtml()
I then created the following method that I call from my templates to return a string saying if the page is valid or not.
If you have a base template, you might want to the footer of every page to display if it is valid (X)HTML or not.
That’s all you need to do to add validation support to your site. You can check the middleware out in action on my site at http://blackberrytracker.com. Scroll to the bottom of the page to see where I have the validation result.
As I stated previously how much I like Genshi…I’ve come to realize that the performance of Genshi under high traffic is very bad. It could be the complexity of the templates that I am using, but I’m only using a few py:match’s and they are using once=”true”.
I decided to benchmark Mako against Genshi for my site. Both templates are identical minus the syntactical differences of Genshi vs. Mako. I used the Apache HTTP server benchmark to test the site. The site uses Pylons, SCGI, and Lighttpd.
NOTE: I did not use any caching for these tests.
Average Requests Per Second: 54.65
Average Requests Per Second: 1.69
As you can see from the graph below, not only is the response time for Genshi much higher, but the amount of requests fulfilled per second was about 50 times less than with Mako.
I also tested the template generation time for both Genshi and Mako. I used the render() method in Pylons for testing.
Mako: 3 ms(average) Genshi: 125 ms(average)
For the templates that I am using on my site it looks like using Mako is 40 times faster than Genshi.
I love Genshi but when it comes down to a high performance, high traffic site, it looks like Mako is a much better choice. I guess the tradeoff is using an XML vs. text based template language. I think I’ll be using Mako from now on, until Genshi becomes more mature and hopefully more optimized. Sorry Genshi!
Check out my new site with information on CableCard/TiVo. I’ll be looking into reverse engineering CableCard and be compiling my findings on the site. http://cablecard.tech9computers.com