Weather in San Francisco
Current Conditions
Temperature: 50.2°F
Wind Speed: 14.8 km/h
Data fetched by Scheduled Function at: (UTC)
Page generated (Cache Purged) at: (UTC)
How it works
This page demonstrates how to use Netlify Scheduled Functions combined with Cache Tags and Netlify Blobs to create a daily updated static page.
- A Scheduled Function runs daily.
- It fetches the latest weather data from an external API and saves it to Netlify Blobs.
- It then purges the cache tag
weather-sfusing the Cache API. - The next time you visit this page, Netlify sees the cache is invalid (purged) and regenerates the page using the latest data from the Blob store.
- The page is then cached again with
Netlify-CDN-Cache-Controland theweather-sftag, waiting for the next daily purge.