src/inc/udc.h 1.14
1.14 2009/11/06 05:08:01 angie
More changes motivated by udcFuse performance: added udcCacheAge, udcCacheTimeout and udcSetCacheTimeout. If cache files exist and are younger than the cache timeout threshold, don't fetch info from the remote server when opening, just use size and date from bitmap file. This saves 0.8s per open for ftp to NCBI. By default, cache timeout is 0 (same behavior as before -- always fetch info).
Index: src/inc/udc.h
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/inc/udc.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -b -B -U 4 -r1.13 -r1.14
--- src/inc/udc.h 5 Nov 2009 19:45:30 -0000 1.13
+++ src/inc/udc.h 6 Nov 2009 05:08:01 -0000 1.14
@@ -129,5 +129,17 @@
int udcSizeFromCache(char *url, char *cacheDir);
/* Look up the file size from the local cache bitmap file, or -1 if there
* is no cache for url. */
+unsigned long udcCacheAge(char *url, char *cacheDir);
+/* Return the age in seconds of the oldest cache file. If a cache file is
+ * missing, return the current time (seconds since the epoch). */
+
+int udcCacheTimeout();
+/* Get cache timeout (if local cache files are newer than this many seconds,
+ * we won't ping the remote server to check the file size and update time). */
+
+void udcSetCacheTimeout(int timeout);
+/* Set cache timeout (if local cache files are newer than this many seconds,
+ * we won't ping the remote server to check the file size and update time). */
+
#endif /* UDC_H */