rewrite cache logic to use request ttl instead