๐ค๏ธ Weather - Page Output Caching
Entire HTML page cached in Redis for 60 seconds
๐ What is Page Output Caching?
The page uses ASP.NET Core's [OutputCache] attribute to cache the complete rendered HTML in Redis. Subsequent visitors get the cached HTML instantly without re-rendering the page.
What's Cached:
Entire HTML page (complete output)
Where It's Stored:
Redis
Cache Duration:
60 seconds
First Load:
~5 seconds (API call + page render)
Cached Loads:
Instant (served directly from Redis)
โฑ๏ธ Page Cached At
This HTML was generated and cached at:
Cache timestamp:
03:42:49.564
๐งช Page Cache Testing
Instructions for testing the page cache functionality
๐ก Test:
The page loads instantly and shows loading state while fetching fresh data each time!
โฑ๏ธ Note:
The API call takes ~5 seconds due to the artificial delay, but the page displays immediately with a loading state.
๐ Page Loading:
Demonstrates fast page rendering with interactive loading states and user feedback!
๐ How to Test:
Click "Test Page Loading" โ Page loads instantly, then data loads asynchronously with loading indicators!
๐ค๏ธ Weather Forecast
Current weather data (cached in Redis at API controller level)
Date | Temp. (C) | Temp. (F) | Summary |
|---|---|---|---|
| 03/15/2026 | -1 | 31 | Freezing |
| 03/16/2026 | 9 | 48 | Bracing |
| 03/17/2026 | 19 | 66 | Hot |
| 03/18/2026 | 32 | 89 | Warm |
| 03/19/2026 | 27 | 80 | Cool |
๐ Test Page Loading
Test the page loading functionality
๐ Test Page Output Cache (Refresh Page)
๐ This link refreshes the page - entire HTML output is cached for 60 seconds!
Notice: First load is slow (~5 seconds API call), subsequent loads are instant (cached HTML served directly).
After 60 seconds, cache expires and the page will call the API again.