Implement a custom caching mechanism with Time-To-Live (TTL) expiration for high-frequency API responses in a distributed microservices environment. Implement ttl_cache(operations, ttl) using simulated timestamps. Each operation is ['set', key, value, timestamp] or ['get', key, timestamp]; return the values from GET operations in order, using -1 for misses or expired entries. An entry expires when current_time >= insertion_time + ttl.
def ttl_cache(operations, ttl):