Make Cache Key Optional?
See original GitHub issueIs it possible to make the key optional and hence make the cache action read-only? This is in the case that you know that you only want to read from one of the “restore” keys and to fail if you can’t find one.
For clarity, look for restore key patterns only:
On cache hit - read the cache, don’t attempt to write a new one. On cache miss - job fail.
An alternative could be to recognize a specific string as the key which means skip the write on job completion:
uses: actions/cache@v1
with:
path: cache
key: donotwrite
restore-keys: myexpectedcache-
Issue Analytics
- State:
- Created 4 years ago
- Reactions:7
- Comments:6
Top Results From Across the Web
Spring Caching - ignore parameter for key - Stack Overflow
Save this question. Show activity on this post. I want to cache the results of a simple getter that has an optional parameter...
Read more >Controlling the cache key - Amazon CloudFront
In the Cache key and origin requests section, make sure that Cache policy and ... This is optional, but it can help you...
Read more >Create custom cache keys - Cloudflare Docs
Under Then the settings are, choose Custom Cache Key from the dropdown. Click the appropriate Query String setting. (Optional) Click ...
Read more >Cache.keys() - Web APIs - MDN Web Docs
The keys() method of the Cache interface returns a Promise that resolves to an array of Request objects representing the keys of the...
Read more >29. Cache Abstraction - Spring
Since caches are essentially key-value stores, each invocation of a cached ... This option comes in handy when an entire cache region needs...
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
This would be nice. I have a use case where on job 1 I download a file off a server and then create a cache of said file with the key file-${{ hashFile(file) }}, on job 2 I need to do a restore on that exact key but the file does not exist in job 2 and I don’t want to download the file every single time so I want to call a cache restore with the restore key of file- so it does a partial match and restores the lastest key. The problem with the current implementation is I need to generate a bogus unique key for every single run so I don’t get a cache hit and restore a version that might not be valid but then I’m storing the same file over and over with different bogus keys.
This issue was closed because it has been inactive for 5 days since being marked as stale.