STEP 2 OF 9 · ADD A CACHE
Ask a cache first
Put an in-memory alias cache next to the redirect service. The service checks the cache before the store. This pattern, where the application reads the cache and fills it itself, is usually called cache-aside.
Each entry carries a TTL of 60 seconds. After that the entry expires and the next request goes back to the store.
Why it matters. The cache is a copy. Deciding where the copy lives and how long it may be trusted comes before choosing any cache product.