You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Explain how or demonstrate with an example how to trigger a Python Worker "in the background" with an AJAX script or concurrency so that it doesn't disrupt the normal page loading flow when attached to a route?
Additional information
I want to insert to the key value store via a worker simultaneously as the page loads. But when I attach the worker to a route with a routing rule, the response object is rendered to the browser. Working on a Python worker like this but running into too many redirect loops with fetch or redirects:
from js import Response, fetch
from datetime import datetime
import os
async def on_fetch(request, env):
await env.KV_VALUE.put("stuff", str(datetime.now()))
return await fetch(request.url)
The text was updated successfully, but these errors were encountered:
Existing documentation URL(s)
https://developers.cloudflare.com/workers/languages/python/examples/
https://developers.cloudflare.com/workers/examples/
What changes are you suggesting?
Explain how or demonstrate with an example how to trigger a Python Worker "in the background" with an AJAX script or concurrency so that it doesn't disrupt the normal page loading flow when attached to a route?
Additional information
I want to insert to the key value store via a worker simultaneously as the page loads. But when I attach the worker to a route with a routing rule, the response object is rendered to the browser. Working on a Python worker like this but running into too many redirect loops with fetch or redirects:
The text was updated successfully, but these errors were encountered: