[Utilities] Create caching utility
See original GitHub issueWe need a helper function that will get/set/delete files from a cache directory.
On a local machine that would be the .netlify/cache
dir
Inside Netlify CI that directory is path.join('/opt/build/cache')
The caching utilities should be smart and save file hashes. A v1 attempt at this was done over here: https://github.com/DavidWells/cache-me-outside
These utilities will be used by plugin authors to make it easier for them to interact with the file cache.
File cache might be used for file storage or for storing values between builds. E.g. the google lighthouse plugin storing page scores between builds
Issue Analytics
- State:
- Created 4 years ago
- Comments:16 (15 by maintainers)
Top Results From Across the Web
Create Cache Schema utility—ArcGIS Server
The Create Cache Schema utility allows you to define a map or image service cache from the command line, including the scales, server...
Read more >Caching Server Utility on the Mac App Store - Apple
Caching Server Utility is a macOS app to discover what caching servers available on the network. Makes troubleshooting easier.
Read more >-Xshareclasses option - IBM
Some cache utilities can work with caches from previous Java™ versions or caches that are created by JVMs with different bit-widths.
Read more >Delete Cache utility—ArcGIS Server
The Delete Cache utility allows you to delete map or image service caches using the command line. This utility deletes the entire cache,...
Read more >Create Cache Schema utility - ArcGIS Server
The Create Cache Schema utility allows you to define a map or image service cache from the command line, including the scales, server...
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 Free
Top 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
Thinking something like this.
save
(or set),get
,delete
(or remove)The
cacheData
being referred to above is something like:This information is available for the
shouldCacheUpdate
function to quickly diff hashes. That data is also returned from thesave
methodSee how should update works in this flow chart.
I wasn’t too crazy about
cache-me-outside
’s API taking an array of these config objects. The updating (shouldUpdate
+handleUpdate
) logic works really well though.There is also a
diff
util that is available in here. This is very handy for not reimplementing hashing logic.Example:
README
improved in #704.