make S3 caching significantly more generic
Merge pull request #11890 from twbs/generic-caching

make S3 caching significantly more generic