lejog.maniacmartin.com retired

The cycle ride is over, and I'm in the process of collecting those pledged sponsorships. People have an amazing ability to not have any money on them when its time to pay up, which is pretty convenient for them.

Anyway, I figured that I will not be updating the website any more, since all of the days are already blogged. Due to the heavy GPX caching and the fact it was my first Django (and web framework for that matter) usage, which I chopped and changed many times, keeping this dead site online was costing me 71MB of RAM, which is quite a sizable proportion of my 256MB VPS.

I decided that the best way was to make a static snapshot of the site, and serve it with my regular httpd directly.
It was basically a matter of getting the snapshot:
wget -nH -m http://lejog.maniacmartin.com
And renaming the GPX files and their references by running these commands from the appropriate directories:
for i in $(ls|grep -v index); do sed -i s@/posts/gpx/$i/@/posts/gpx/$i.gpx@g $i/index.html; done
for i in $(ls|grep -v index); do mv $i/index.html $i.gpx; rm -r $i/; done

I then copied the static/ and media/ folders over.

I also added a mime type for GPX files for cleanliness to /etc/mime.types:
application/gpx+xml gpx
(You could also use the more generic text/xml type)

I know for a Django site, this leaves a mess of folders all containing a single index.html page, but since the site will never be updated again, it frees up RAM and CPU cycles (caching of parsed GPX is intensive), and means that the site will load faster. Given the heavy usage of Google Maps, any speed up is a bonus.

Posted 16th September 2008 in Computer, and Life, with 0 comments

Digg!

comments


  1. (optional)