Caching is a challenge, especially with web SPA apps. Push vs. pull and owned vs. user assets play a crucial role. The best strategy is to make everything push + owned, allowing for infinite expiration time. UI icons as push + owned assets are a classic example. Using stale-while-revalidate access patterns is key for offline functionality. Pull + owned and push + user assets can be handled with hashed URLs. Pull + user content, such as user-generated content not owned by the server, requires a short TTL and stable URLs. By understanding user behavior and implementing the right caching strategy, developers can optimize performance and user experience.
https://hazelweakly.me/blog/cache-me-not-cache-me-cache-me-not/