Fetching & Displaying Data

What technique should be used to optimize data fetching for frequently accessed resources?
const cache = new Map();

async function fetchWithCache(url, options = {}) {
  const cacheKey = `${url}-${JSON.stringify(options)}`;
  if (cache.has(cacheKey)) {
    const { data, timestamp } = cache.get(cacheKey);
    if (Date.now() - timestamp < 5 * 60 * 1000) return data;
  }
  
  const response = await fetch(url, options);
  const data = await response.json();
  cache.set(cacheKey, { data, timestamp: Date.now() });
  return data;
}
Next Question (11/20)