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

    sathoro

    02/18/2023, 4:57 PM
    this is much worse
  • s

    sathoro

    02/18/2023, 5:00 PM
    https://github.com/honzabit/durable-limiter I was using this locally and it worked perfectly. but when deploying I noticed it wasn't actually rate limiting requests. so I tried removing the calls to the caching API and then it worked. basically the caching expiring was seeming to not work properly once deployed as a service bound worker
  • s

    sathoro

    02/18/2023, 5:01 PM
    actually probably their caching logic is just wrong since caching doesn't work locally right?
  • s

    sathoro

    02/18/2023, 5:04 PM
    how the heck did they expect caching and rate limiting to work together
  • s

    sathoro

    02/18/2023, 5:06 PM
    ohh they only cache rate limited responses. but I am pretty sure in reality what is happening is non-rate limited responses are getting cached too
  • d

    Deleted User

    02/18/2023, 5:08 PM
    Is it possible to return an html page in a different file with workers
  • d

    Deleted User

    02/18/2023, 5:09 PM
    without having the html file hosted or having to paste the entire html in the worker
  • h

    HardAtWork

    02/18/2023, 5:09 PM
    From KV?
  • s

    sathoro

    02/18/2023, 5:10 PM
    you could fetch from a CDN
  • s

    sathoro

    02/18/2023, 5:10 PM
    and cache it
  • s

    sathoro

    02/18/2023, 5:10 PM
    like raw.github.com if you like to live dangerously
  • d

    Deleted User

    02/18/2023, 5:10 PM
    That could work but the file gets overwritten often, its a weird case
  • d

    Deleted User

    02/18/2023, 5:11 PM
    I could just use pages if I needed it to be available like that
  • s

    sathoro

    02/18/2023, 5:11 PM
    hey you asked for solutions
  • s

    sathoro

    02/18/2023, 5:11 PM
    using pages and having it on github are not exactly equivalent
  • d

    Deleted User

    02/18/2023, 5:11 PM
    I also said "without having the file hosted"
  • s

    sathoro

    02/18/2023, 5:12 PM
    well
  • h

    HardAtWork

    02/18/2023, 5:12 PM
    How often?
  • s

    sathoro

    02/18/2023, 5:12 PM
    depends on what you mean by hosted... if it is not in your worker... and it isn't hosted... what are you expecting?
  • d

    Deleted User

    02/18/2023, 5:12 PM
    every deploy basically
  • d

    Deleted User

    02/18/2023, 5:12 PM
    so like once a day
  • d

    Deleted User

    02/18/2023, 5:12 PM
    or more
  • h

    HardAtWork

    02/18/2023, 5:12 PM
    KV would be fine, as long as it is less than about once a minute
  • d

    Deleted User

    02/18/2023, 5:13 PM
    KV would definitely work but is there no way to just import an html file into the worker?
  • d

    Deleted User

    02/18/2023, 5:13 PM
    If not that will do, thank you!
  • s

    sathoro

    02/18/2023, 5:13 PM
    part of the build process you could do that
  • h

    HardAtWork

    02/18/2023, 5:14 PM
    You can, but then it would be a "part of your worker", which you didn't want.
  • d

    Deleted User

    02/18/2023, 5:14 PM
    it's mostly for code readability
  • d

    Deleted User

    02/18/2023, 5:14 PM
    its fine if its in the code but as long as I can edit in another file
  • h

    HardAtWork

    02/18/2023, 5:14 PM
    I mean, once a Worker is deployed, it doesn't need to be readable.
1...228222832284...2509Latest