I am developing my first project with CF and I am unsure whether to use workers or page functions.
I need 3 workers:
- worker 1: will be called by an external service, process that data and write it into a KV store with a key. It will then mail the key like this [worker2 url]/?param=key
- worker 2 is called with the above genreated url, and will use the key to retrieve the data from the KV store. Worker 2 then presents a HTML page to the client where the client can modify a PDF
- worker 3 is generating the PDF
Worker 2 and 3 will be very similar to the two workers in this great example: https://workers.cloudflare.com/built-with/projects/lazy-invoice/
In that example, which is a bit older, only workers are used, but not pages. However, worker 2 (the invoice worker in the example) mainly just returns a lot of HTML, so i was wondering if it may not be more suitable today to replace that worker with a page.
Lets assume its example.pages.dev
This page could maybe have some very simple landing page at example.pages.dev, but the main idea use of the page are doing GET requests to example.pages.dev/?param= in which case the user making the request is authentified and the retrieved data is shown on the page.
My question is, does it still make sense to do this with workers as in the invoice example above, or does it make more sense to replace these 3 workers with 3 page functions?