Support some form of "read only cache" or "centralized cache"
Description:
@actions/cache now ships @actions/cache/save and @actions/cache/restore actions to easily implement different caching strategies. One of the strategies they document is "Make cache read only / Reuse cache from centralized job", where you only restore in jobs.
Justification: It'd be nice to support this caching strategy / others in the future in this action natively to allow users to easily adopt or test strategies without having to opt out of this action's caching and implementing them themself.
Are you willing to submit a PR? If I can find time
Hello @ramblingenzyme đź‘‹, Thank you for reporting this feature request. We will investigate it and get back to you as soon as we have some feedback.
This would be nice, I have a couple of workflows running on self hosted runners that should be allowed to consume cache, but ideally I'd like to avoid the post action as it takes long and is not needed on those specific workflows.
@priya-kinthali I would be up to implement this change.
Is it fine to move forward with it?
Hi Everyone, thank you for your detailed feature request and for outlining the benefits of supporting read-only or centralized caching natively in setup-node.
At this time, we've reviewed the proposal but found limited community demand. Given that the existing functionality in @actions/cache already supports these strategies—such as read-only or centralized restore logic. we recommend continuing to use those patterns directly for now.
We'll keep an eye on future interest and reconsider if broader community support emerges. Thanks again for your thoughtful suggestion! Please feel free to reach us in case of any concerns/clarifications :)