130388103d6579f91a15a0922b5f237b689894b6
chmalee
  Tue May 18 15:56:51 2021 -0700
Fix hgTracks web browser caching again. This time allow CGIs to specify their own HTTP headers, as of now only hgTracks prevents caching. refs #26627

diff --git src/hg/hgTracks/mainMain.c src/hg/hgTracks/mainMain.c
index dbe437c..e45f1ce 100644
--- src/hg/hgTracks/mainMain.c
+++ src/hg/hgTracks/mainMain.c
@@ -47,30 +47,33 @@
 char * link = webTimeStampedLinkToResourceOnFirstCall("HGStyle.css",TRUE); // resource file link
 if (link)                                                                  // wrapped in html
     htmlSetStyle(link);
 
 oldVars = hashNew(10);
 
 if (cgiVarExists("hgt.redirectTool"))
     {
     // user has selected one of the tools in View > In external tools: Do not plot, just redirect.
     printf("Content-type: text/html\n\n");
     errAbortSetDoContentType(FALSE);
     cart = cartForSession(hUserCookie(), NULL, NULL);
     extToolRedirect(cart, cgiString("hgt.redirectTool"));
     }
 else
+    {
+    httpHeaders = slPairNew("Cache-Control", "no-store");
     cartHtmlShell("UCSC Genome Browser v"CGI_VERSION, doMiddle, hUserCookie(), excludeVars, oldVars);
+    }
 
 // TODO: better place for this ?
 puts("<link rel=\"stylesheet\" href=\"https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css\">\n");
 
 if (measureTiming)
     measureTime("Time to write and close cart");
 if (measureTiming)
     {
     fprintf(stdout, "<span class='timing'>Overall total time: %ld millis<br /></span>\n",
             clock1000() - enteredMainTime);
     }
 cgiExitTime("hgTracks", enteredMainTime);
 return 0;
 }