Significant speed-up on cacheable requests, cleaned-up code