Giter Site home page Giter Site logo

Comments (9)

dshkol avatar dshkol commented on August 24, 2024

Does it make sense to add a function to wipe caches? Or is that taken care by forcing the load function to redownload the data. Kind of a power user need.

from cancensus.

atheriel avatar atheriel commented on August 24, 2024

The existing use_cache = FALSE parameter will do just that. I think I mentioned it in the documentation, too.

from cancensus.

atheriel avatar atheriel commented on August 24, 2024

(So I think we can close this.)

from cancensus.

mountainMath avatar mountainMath commented on August 24, 2024

I am starting to think that we need to strike a balance between caching and making sure data is up-to-date. For example, on the list_datasets call the user may not find out about new datasets that we might add. Even if it is slow-changing, that might cause problems. Also, the list_vectors will likely undergo changes as I clean up the server side data.

I see three reasons we do caching:

  1. to avoid unnecessarily spending API points (the reason for the limit on API points is point 2)
  2. to reduce server load
  3. to allow people to run and refine their analysis offline

Point 1. only applies to the load_data calls, and I think letting the user decided when to reload the data is good. For the other calls it would be just fine if we only make calls, say, once a day. That the user doesn't have to worry about refinements to the vector data. Or we use the cache-expiry headers from the http call to determine how long they stay fresh, that way we can up that time server side at a later stage when the calls become stable.

from cancensus.

atheriel avatar atheriel commented on August 24, 2024

One way to do this would be to cache the caching information from the server (e.g. the ETag) along with the object, and then send an If-Changed-Since request to the server. I believe this is what browsers do, but I'd have to think about how to do it in R.

from cancensus.

atheriel avatar atheriel commented on August 24, 2024

Alternatively, we could store the cache timestamp and force and an update if it gets too old.

from cancensus.

dshkol avatar dshkol commented on August 24, 2024

That could work. You could prompt the user with a note that their cached data is old and give them the option to reload, but that might be overkill.

from cancensus.

atheriel avatar atheriel commented on August 24, 2024

Actually, it's likely a simple warning would suffice, and be the least intrusive.

from cancensus.

atheriel avatar atheriel commented on August 24, 2024

This should be closed now that #54 is merged. If we want to have more discussion of cache invalidation, it should be in a separate issue I think.

from cancensus.

Related Issues (20)

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.