perform in memory caching

this saves us from manually cleaning the cache after restarting the app
only convert to utf-8 for suitable content types