enso
enso copied to clipboard
HTTP response caching, with TTL and LRU logic
This implements
- A response cache for HTTP.{fetch,request} and Data.{read,fetch} and other methods that use those. (Data.download is not cached.)
- Per-file request limit
- Total cache size limit
- TTL logic, based on HTTP response headers if available
- LRU logic for removing old entries to make room
Checklist
Please ensure that the following checklist has been satisfied before submitting the PR:
- [x] The documentation has been updated, if necessary.
- [x] Screenshots/screencasts have been attached, if there are any visual changes. For interactive or animated visual changes, a screencast is preferred.
- [x] All code follows the Scala, Java, TypeScript, and Rust style guides. In case you are using a language not listed above, follow the Rust style guide.
- [x] Unit tests have been written where possible.
- [x] If meaningful changes were made to logic or tests affecting Enso Cloud integration in the libraries,
or the Snowflake database integration, a run of the Extra Tests has been scheduled.
- If applicable, it is suggested to paste a link to a successful run of the Extra Tests.
Comments resolved except for nio change.
@radeusgd I implemented your excellent suggestion, including the metadata handling. I also separated it into EnsoHTTPResponseCache (which handles headers, TTL calculation, etc) from LRUCache (which handles caching, downloading, expiry, etc), as per @jdunkerley's suggestion.