A kind person wrote me an e-mail asking me to make an improvement on a little known but often stumbled-upon section of my web server, the Shanghai Bus Routes in English project. The project's big failing is that it has always lacked a way to search the routes for a specific stop.
The letter-writer's idea was simple and elegant: generate one giant web page with all of the bus routes on it and let the web browser do the searching. So I got to work and 10 minutes (cat
and a few of emacs' query-replace
s) later I have a working product. Be careful, though, it is almost one megabyte in size so if you intend to use it often it is better to download a copy to your own computer.
7 Comments:
With such a large page (all of it text) you would be better off creating a gzipped version. You can use something like php (http://us.php.net/ob_gzhandler) to compress the page on the fly. It will make the actual file smaller and the browser will uncompress it on the fly.
Wouldn't that just be a matter of telling the web server to gzip requests from browsers that can handle it? Seems like a couple lines in the .htaccess file should enable it... I'll look it up.
Yes, the web server should have no trouble doing it. I was assuming that you didn't have any control over your server.
Thanks mister, that is really cool.
Thank you -- brilliant. Liz
P.S. Stop number 11 on route 925 is S Shanxie Road, not Huashan Road twice!
I know because I catch that bus home every night and I get off at Shanxie Lu
Thanks Liz! I will update it by hand. I hope the official Shanghai Transportation Authority site can fix it by the next update.
Post a Comment
« Home
Post a Comment