rstudio / shiny

Easy interactive web applications with R
https://shiny.posit.co/
Other
5.37k stars 1.86k forks source link

bindCache Using S3 Bucket as Disk-Cache Object #3282

Open masato-yoshihara opened 3 years ago

masato-yoshihara commented 3 years ago

I'm wondering whether I can use a S3 bucket as a disk-cache object or, at the very least, a location where I can store my caches when using the bindCache function. I'm planning on hosting my Shiny app using AWS's Elastic Container Service, and I'm concerned that caches made in one container will not be available and/or disappear when the system scales up or down. Thank you!

wch commented 3 years ago

It is possible to use S3 for a cache. I've put a document with a demo here: https://rpubs.com/wch/aws-s3-cache-demo

Note that S3 is used not as a disk cache object, but as a completely different type of caching object.

A couple caveats: I don't know enough about the aws.s3 package to say how robust it is. Also, the demonstration uses cachem::cache_layered(), which is still in an experimental stage of development.

masato-yoshihara commented 3 years ago

Thanks so much for the response Winston! I'm going to try it out in a bit, and I'll report back how it turns out!

wch commented 3 years ago

Great, I hope it works for you!