https://discord.cloudflare.com logo
Join Discord
Powered by
# workers-discussions
  • d

    dave

    05/24/2023, 5:56 PM
    if it's something that could change, then IMO I would do like:
    Copy code
    javascript
    setInterval(() => {
      const link = document.createElement("link");
      link.setAttribute("fetchpriority", "low");
      link.setAttribute("rel", "preload");
      link.setAttribute("href", `/geolocation.json`);
      link.setAttribute("as", "fetch");
      link.setAttribute("crossorigin", "anonymous");
      document.head.appendChild(link);
    }, 60000)
    You should probably remove the old link so you don't end up with hundreds of elements in your header over time 😛
  • u

    𝓣𝓸𝓫𝓲

    05/24/2023, 5:57 PM
    hmm, it could change, but you wouldn't expect the user to suddenly change country xD
  • n

    nora

    05/24/2023, 6:11 PM
    early hints?
  • n

    nora

    05/24/2023, 6:12 PM
    sounds like y'all are implementing early hints, just that early hints would arrive at the client even sooner, though support is limited still
  • n

    nora

    05/24/2023, 6:12 PM
    https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/103#browser_compatibility
  • n

    nora

    05/24/2023, 6:13 PM
    ooh seems like chrome has enabled it by default now
  • k

    kian

    05/24/2023, 6:19 PM
    since Chrome 103
  • k

    kian

    05/24/2023, 6:19 PM
    oh hey Edge does too - I guess by extension of being Chromium
  • k

    kian

    05/24/2023, 6:19 PM
    Safari is the one I'll be hoping for - Safari on iOS is a big chunk of our users
  • b

    boywithkeyboard

    05/24/2023, 7:22 PM
    what permissions does my api token need for
    wrangler deploy
    ? i'm using only
    Workers Scripts:Edit
    permission at the moment and get an "unauthorized" error in my logs...
  • n

    Neiki

    05/24/2023, 7:26 PM
    bump
  • p

    Peter Belbin

    05/24/2023, 8:00 PM
    hey there folks. question: https://github.com/cloudflare/wrangler-legacy/pull/2221 talks about being able to mark assets for future expiration of cached content to avoid users getting 404 errors when a new deployment happens for Wrangler workers. It also talks about providing something similar for 2.x (and now we're on 3.x). What's the story with this currently (particularly for 3.x). How does KV content get held over until the upgrade is done currently? Really want our users to not see 404 errors because they've been cuaght mid-update.
  • j

    James

    05/24/2023, 8:05 PM
    I believe in v2/v3 with Workers Sites, old assets are deleted as soon as new ones are published (ref: https://github.com/cloudflare/workers-sdk/blob/4082cfcbdf08740d4a608d3d87df22e51ad0ce4a/packages/wrangler/src/sites.ts#L319). The holistic solution these days would be to migrate to Cloudflare Pages (https://pages.cloudflare.com/) where development efforts are focused instead of Workers Sites
  • c

    Cyb3r-Jok3

    05/24/2023, 8:10 PM
    Workers doesn’t have error notifications. You have to put those in your script
  • n

    Neiki

    05/24/2023, 8:18 PM
    but i cant catch the "Exceeded Resources" thing, it just happens sometimes i cant really say why its weird (only happend twice so far) but i thought maybe i can let me notify or something
  • k

    kian

    05/24/2023, 8:25 PM
    https://developers.cloudflare.com/workers/platform/tail-workers/ if you're on a paid plan
  • n

    Neiki

    05/24/2023, 8:26 PM
    thanks and yes
  • l

    Liberator

    05/24/2023, 8:29 PM
    is there a way to use LLMs like ChatGPT efficiently with workers?
  • n

    Neiki

    05/24/2023, 8:48 PM
    nvm sorry i found it, sorry for ping
  • b

    bulk88

    05/24/2023, 8:56 PM
    https://pastebin.com/JC7ZvpAg
  • b

    bulk88

    05/24/2023, 8:56 PM
    Invalid Workers Preview configuration | my.domain.com | Cloudflare
  • b

    bulk88

    05/24/2023, 8:57 PM
    Improperly configured Workers Preview for my.domain.com. You may need to reinitialize.
  • b

    bulk88

    05/24/2023, 8:57 PM
    this is annoying, unpredictable, and random, in the new quick editor, every couple of minutes
  • b

    bulk88

    05/24/2023, 8:59 PM
    seems I need to press F5 about once for every 2-3 send clicks for some reason or another in the new editor
  • d

    dave

    05/24/2023, 9:11 PM
    Correct. It's a bit annoying to have to have different preloading implementations for Chrome vs Safari though. For ease of use, we just stick with doing preloading client side for now.
  • d

    dave

    05/24/2023, 9:12 PM
    and those are the ones with the slow interwebz who you care about usually 😛
  • d

    dave

    05/24/2023, 9:17 PM
    @sathoro btw Supabase staff will turn off rate limiting for your project if you ask them and say it's because you're using a Worker. Don't think you were running into issues yet, but figured I should share the info.
  • b

    bulk88

    05/24/2023, 9:28 PM
    Connections.ts:87 WebSocket connection to 'wss://mydomain.com/cdn-cgi/workers/preview/inspector?cf_workers_preview_token=AQU-syj2zDktl6PV_yvXeINb' failed:
  • b

    bulk88

    05/24/2023, 9:29 PM
    'Debugging connection was closed. Reason: WebSocket disconnected\nReconnect when ready by reopening DevTools.\nReconnect DevTools'
  • b

    bulk88

    05/24/2023, 9:30 PM
    does the CF WAF or some other toggle in the dashboard actually block the new CFW quick editor?
1...249224932494...2509Latest