Use views.sync() when you need fresh results right now. A sync re-executes the view query and updates the materialized files in the virtual filesystem.
views.sync() is idempotent and safe to call repeatedly. It is a good fit for pre-read checks, cron jobs, and retryable worker tasks.
Single-view sync
Sync strategy
Before-read refresh pattern
If your workflow requires freshness, sync first and then read from the view path.
Scheduled sync job
This pattern works for periodic refresh workers. Keep sync tasks retry-friendly and continue if one view fails.