KarolNov commented on code in PR #17510:
URL: https://github.com/apache/tvm/pull/17510#discussion_r1835674586


##########
web/src/artifact_cache.ts:
##########
@@ -353,6 +353,138 @@ export class ArtifactIndexedDBCache implements 
ArtifactCacheTemplate {
   }
 }
 
+/**
+ * Cache by storing results as files in OPFS file system
+ * 
https://developer.mozilla.org/en-US/docs/Web/API/File_System_API/Origin_private_file_system
+ */
+export class ArtifactOPFSCache implements ArtifactCacheTemplate {
+  private dirName?: string;
+  private fileVersion = 1;
+  private dirHandle: FileSystemDirectoryHandle | null = null;
+
+  constructor(dirName: string) {
+    // use the version suffix to allow upgrade if needed
+    this.dirName = `${dirName}-v${this.fileVersion}`;

Review Comment:
   I'm new to this repo, but it seems versioning is not really needed here and 
it's up for user to version the urls instead. However storing the `-vX` suffix 
would allow to do internal breaking changes in the file structure by just 
creating a new OPFS cache handler that uses different dir name `-v2`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to