From 04b59540c07e95a674b02a50010759b9de3fd611 Mon Sep 17 00:00:00 2001 From: JoeStrout Date: Mon, 11 Nov 2024 15:26:09 +0000 Subject: [PATCH 1/2] Add cache_control="no-cache" to try to fix stale-data problem. --- zetta_utils/db_annotations/precomp_annotations.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zetta_utils/db_annotations/precomp_annotations.py b/zetta_utils/db_annotations/precomp_annotations.py index c54a84d72..e91514d8d 100644 --- a/zetta_utils/db_annotations/precomp_annotations.py +++ b/zetta_utils/db_annotations/precomp_annotations.py @@ -149,7 +149,7 @@ def write_bytes(file_or_gs_path: str, data: bytes): if "//" not in file_or_gs_path: file_or_gs_path = "file://" + file_or_gs_path cf = CloudFile(file_or_gs_path) - cf.put(data) + cf.put(data, cache_control="no-cache") def write_lines(file_or_gs_path: str, lines: Sequence[LineAnnotation], randomize: bool = True): From 96f91fd0e647e96ec9afd0c330f6fa28b4f489e0 Mon Sep 17 00:00:00 2001 From: Akhilesh Halageri Date: Mon, 11 Nov 2024 15:39:03 +0000 Subject: [PATCH 2/2] fix(precomputed_annotations): avoid cache entirely --- zetta_utils/db_annotations/precomp_annotations.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zetta_utils/db_annotations/precomp_annotations.py b/zetta_utils/db_annotations/precomp_annotations.py index e91514d8d..8940b26ec 100644 --- a/zetta_utils/db_annotations/precomp_annotations.py +++ b/zetta_utils/db_annotations/precomp_annotations.py @@ -149,7 +149,7 @@ def write_bytes(file_or_gs_path: str, data: bytes): if "//" not in file_or_gs_path: file_or_gs_path = "file://" + file_or_gs_path cf = CloudFile(file_or_gs_path) - cf.put(data, cache_control="no-cache") + cf.put(data, cache_control="no-cache, no-store, max-age=0, must-revalidate") def write_lines(file_or_gs_path: str, lines: Sequence[LineAnnotation], randomize: bool = True):