I share your frustration that this runs at ever page load, though I don't know a better way that's still wordpressy.