An output for exact cache hit
See original GitHub issueI think it would be useful to indicate somehow whether cache was restored using the exact key
or one of the fallback restore-keys
.
A use case for this is being able to skip some subsequent steps only in the case of an exact cache hit. For example, if a build tool uses incremental compilation, a partial cache hit is good, it saves some time, but if the cache hit was exact, we can skip the compilation step altogether which might save us much more time (e.g. build tool loading the project). A concrete case of such build tool it sbt: in a medium-sized project with several modules it might spend up to a minute loading the project.
So I’m suggesting to add another output value to the action which will indicate whether hit was exact or not.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:7
Top Results From Across the Web
Cache dependencies and build outputs in GitHub Actions
Outputs. cache-hit - A boolean value to indicate an exact match was found for the key. Note: cache ...
Read more >Cache Hit Rate - an overview | ScienceDirect Topics
First, the cache hit rate of caching full IP addresses in the backbones is typically at most 80–90% [Par96, NMH97]. Part of the...
Read more >CallCaching - Cromwell - Read the Docs
Call Caching allows Cromwell to detect when a job has been run in the past so that it doesn't have to re-compute results,...
Read more >Performance tuning with result set caching - Microsoft Learn
Result set caching improves query performance and reduces compute resource usage. In addition, queries using cached results set do not use any ...
Read more >What does it mean when action is reported as "local, remote ...
For instance, when the action is executed (clean build with no cache) and when the build is fully cached and output is populated...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
cache-hit
indeed is only true if you’re hitting the primary key.Unfortunately, you can’t distinguish between a
cache-miss
and a hit of arestore-key
.I would love for
cache-hit
to tell me the key it hit instead of just a boolean for the primary key.After reading the documentation again I think
cache-hit
is set to true only on the exact hit, not on the restore key hit. You are therefore not notified about a partial hit at all - it might speed up something or it might not, you are expected to proceed as if there is no hit.This is confirmed by looking at sources:
The documentation could perhaps be changed to explicitly state this, like:
A boolean value to indicate an exact match was found for the key (not set when only a restore key matches)