Add caching, short and midterm. Use the filesystem in prod

Short-term cache is used for the api endpoint, mid-term is used for most templates.