Weather — Caching Demos | Blazor Blueprint
Login Register

📋 Choose a Demo

Three different strategies for handling data

🏢 Tenant-Aware Application Service API

Multi-tenant architecture demonstrated through the caching demos

Organisation-Scoped Controllers

The weather endpoints use [OrganisationScoped] controllers. The API resolves the current organisation from the X-Organisation-Id header and returns the tenant name in the response. Switch organisations to see it change.

Platform-Scoped Controllers

Authentication endpoints like /api/token use [PlatformScoped] controllers that operate without organisation context, handling service-to-service JWT authentication.

📊 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.

Welcome! How can we help you today?
An unhandled error has occurred. Reload