Parse origin file using Worker and trigger cron

Is there a way to parse an origin resource e.g. XML using a worker for a given domain which then triggers a cron with the results?

The file is an XML sitemap with a list of URI locations e.g. <loc>https://www.domain.com/</loc>, <loc>https://www.domain.com/contact/</loc> and so on.

The Cloudflare worker would parse each of these URLs. Once processed a cron would be triggered that requests each URI similar to cURL.

The parsing would be a cron as well as so that it is run every x minutes.

This should indeed be possible - you might be best to use a single worker to do this. You can make up to 50 subrequests per worker call:

If you wrote your script to fetch the sitemap and perhaps use Workers KV to track which URLs have been fetched already. Set this up using a cron trigger to run regularly and have it do nothing when all URLs are done.

Thanks Simon. Is there a similar example I could refer to and build from?

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.