In web-app we expose an endpoint 'api/revalidate' which when called will manually invalidate the server side cache. With this endpoint you can invalidate by
all feeds
gbfs feeds
gtfs feeds
gtfs rt feeds
specific feeds (by id)
End goal: Refresh the cached server feeds when there are changes in the feeds
Current scenario
A cron job is run from Vercel once a day which invalidates all cache.
Ideal scenario
We should only invalidate the cache of the feeds that have been updated with the most precision as possible. Ex: If overnight feeds mdb-2, mdb-5, mdb-1992 were updated, only invalidate those
Tasks:
- For a revalidation is implemented here. The url to revalidate is
http://mobilitydatabase.org/api/revalidate POST with a header containing the secret. The secret will be defined in 1Password and needs to be added to GCP using Teraform.
- For GBFS:
- For GTFS-RT:
- For GTFS - This part will require deduplication as multiple processes can happen back to back, but we would want to revalidate a feed a single time (suggested implementation: using cloud tasks with id to avoid task duplication within a given timeframe):
In web-app we expose an endpoint 'api/revalidate' which when called will manually invalidate the server side cache. With this endpoint you can invalidate by
all feeds
gbfs feeds
gtfs feeds
gtfs rt feeds
specific feeds (by id)
End goal: Refresh the cached server feeds when there are changes in the feeds
Current scenario
A cron job is run from Vercel once a day which invalidates all cache.
Ideal scenario
We should only invalidate the cache of the feeds that have been updated with the most precision as possible. Ex: If overnight feeds mdb-2, mdb-5, mdb-1992 were updated, only invalidate those
Tasks:
http://mobilitydatabase.org/api/revalidatePOST with a header containing the secret. The secret will be defined in 1Password and needs to be added to GCP using Teraform.populate-db.shscript. Only updated feeds should be revalidated after the script runs.functions-python/reverse_geolocation/src/reverse_geolocation_processor.pypopulate-db.shscript. Only updated feeds should be revalidated after the script runs.functions-python/reverse_geolocation/src/reverse_geolocation_processor.pyfunctions-python/tasks_executor/src/tasks/data_import):functions-python/pmtiles_builder)functions-python/update_validation_report)functions-python/batch_process_dataset)