Coder Social home page Coder Social logo

Not all files listed about render HOT 5 CLOSED

dstreufert avatar dstreufert commented on June 27, 2024
Not all files listed

from render.

Comments (5)

dstreufert avatar dstreufert commented on June 27, 2024 1

from render.

Erisa avatar Erisa commented on June 27, 2024

This is because R2 has a limit on how many objects can be listed in a single call to the API, which is 1,000 maximum but (If I recall correctly) can be lower based on the total byte size of the result. https://developers.cloudflare.com/r2/api/workers/workers-api-reference/#r2listoptions

Listing more than this using the Workers bindings requires a change to make multiple list calls, which can dramatically increase the latency and cost of the request, so would be tricky to implement in a sensible way.

from render.

kotx avatar kotx commented on June 27, 2024

We could add a ...see more... link at the bottom of the page if there are more objects to be returned.
This would add a ?cursor=... to the url, which would then return all results after the cursor. You could then list all objects similarly to this method in cloudflare docs.

The question is if you need a configurable limit of objects per page (for example, so you can limit results to 50 per page), and/or an option for listing all files in a single request if the number of subrequests doesn't go over 50 on free, or 1k on paid.
Let me know what works for your needs, I can try to add it in the next few days.

from render.

dstreufert avatar dstreufert commented on June 27, 2024

from render.

kotx avatar kotx commented on June 27, 2024

Just pushed a release (1.4.0) supporting pagination in page listings with ?cursor= as a query.

Even dirs with 255 subdirectories are only showing the first 10-15…

This may be a R2 API limitation. What I think is happening here is you have files in those subdirectories, reaching the listing limit of 1000 so there are only 10-15 unique /-delimited prefixes (=subdirectories).

from render.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.