rstudio / pins-r

Pin, discover, and share resources
https://pins.rstudio.com
Other
312 stars 63 forks source link

Investigate removing content-cache.yml, or refreshing it more frequently #635

Closed machow closed 1 year ago

machow commented 2 years ago

For RSConnect boards, there is a content-cache.yml file that maps content name (e.g. my-mtcars-pin) to its underlying RSConnect identifier (a content guid). However, because changes to the mapping between content and guid can come from multiple places (e.g. other laptops, the web UI) this cache can easily go stale.

Opening this issue to track content-cache related problems, and to track research into what the effects of removing content-cache.yml would be.

Here are some related issues:

Here are issues related to the other cache file, user-cache.yml:

Edit: just a quick note on the two caches to clarify this issue.

machow commented 2 years ago

Potential paths that become slower when cache is removed:

machow commented 2 years ago

Last thing--if we tackle this alongside the pins-python issue of being able to use guids when looking up underlying paths, we can likely work out the fast implementations for looking things across both libraries.

machow commented 2 years ago

From what I can tell, there's no way to completely fix the slowdowns we'd hit by removing the cache, using the current RSC API, but it also might not be too bad?

The issue is that we have two options for going from / -> content :

Because we lack a way to look up content from <user_name>/<content_name>, we have to either take approach (1) and look up each user name manually, or take approach (2) and potentially get a lot of results to filter. Option (2) seems like it would work fairly well?

(Option (2) is also not technically part of the API, so we may want to make sure it won't change?)

hadley commented 1 year ago

This is done by #667, right?

juliasilge commented 1 year ago

We wanted to try out using /applications?filter=content_type:pin&search=<content_name> for some things that are slower now like pin_search(). It's not technically part of the API but we chatted with Kelly about using it.

juliasilge commented 1 year ago

Oh gosh 🙈 we are already doing this:

https://github.com/rstudio/pins-r/blob/633e6e7c0a4f0168516ef10a4e9258e846f32d8b/R/board_connect.R#L345-L360

So yes, I believe this is all done now. ✅

github-actions[bot] commented 1 year ago

This issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue.