sdk-core icon indicating copy to clipboard operation
sdk-core copied to clipboard

[Feature Request] Add TTL to ephemeral server download cache

Open bergundy opened this issue 1 year ago • 0 comments

Currently we cache the downloads in local filesystem indefinitely. For latest the file path is hardcoded and for SDK default we use the SDK name and version in the file path).

This could pose an issue since we'd like users to automatically get enhancements and bug fixes when we release new server versions.

Proposed solution

SDK exposes a TTL field in CachedDownload and checks the downloaded file's mtime to determine whether a new version should be downloaded. For further optimization, the SDK could use If-Modified-Since or Etag headers to avoid downloading from the CDN if there's no new release, if no download is required, touch the downloaded file to avoid hitting the server unnecessarily.

bergundy avatar Mar 04 '23 00:03 bergundy