Worker to pre-render site?
I am trying to get a worker to fetch content from a website, and send HTML in response. Effectively static site generation or pre rendering the content, would this be possible?
5 Replies
let me rephrase i dont need SSG i need SSR on a cloudflare worker
that should be easily doable.
most meta frameworks should support it, e.g. SvelteKit with adapter cloudflare or similar frameworks.
I am using vue without nuxt it is a single page application @tobi This means that when i fetch the website within a worker, it only fetchs the index.html which is a empty div, My guess is that cloudflare does not run the js and wait for the page to load, hence i am stuck in how i can use a worker to render the page on the worker and spit out the html... -- right now it works but the div has no content which is expected since its a spa.
of course, why would a worker do something that it is not told to do?
the worker will only fetch, if that is what the script says.
right,what i was thinking is using a redirect with a html rewrite.