Weather - Caching Demos
Login Register

๐Ÿ“‹ Choose a Demo

Three different strategies for handling data

๐Ÿ“Š Quick Comparison

Key differences between the three strategies

Feature Page Cache Controller Cache Real-Time
What's Cached Entire HTML page API response data only Nothing
Cache Duration 60 seconds 60 seconds N/A
First Load ~5 seconds ~5 seconds Instant
Cached Load Instant <500ms Updates every 2s
Best For High-traffic static pages Expensive API calls Live dashboards

๐Ÿงช How to Test

What to expect with each demo

๐Ÿ”„ Page Caching

First load: ~5 seconds. Refresh: instant (same HTML from Redis for 60 seconds).

๐ŸŽฏ Controller Caching

First API call: ~5 seconds. Next calls: <500ms (data from Redis for 60 seconds).

โšก Real-Time

Automatic updates every 2 seconds. Always fresh data - no caching.

โ„น๏ธ About the 5-Second Delay

The API includes an artificial 5-second delay to simulate expensive operations (like database queries or external API calls). This makes the caching benefits easy to see.

An unhandled error has occurred. Reload ??