Fossil SCM

Add ETags cache control to the /tarball, /zip, and /sqlar pages.

drh 2018-02-25 19:09 UTC etags-cache-control
Commit f2492f3bb65a13d6e48951f0b7305d9bd927458c6c129ad3560bc8c2e4d25b59
2 files changed +1 +1
+1
--- src/tar.c
+++ src/tar.c
@@ -731,10 +731,11 @@
731731
blob_appendf(&cacheKey, "/tarball/%z", rid_to_uuid(rid));
732732
blob_appendf(&cacheKey, "/%q", zName);
733733
if( zInclude ) blob_appendf(&cacheKey, ",in=%Q", zInclude);
734734
if( zExclude ) blob_appendf(&cacheKey, ",ex=%Q", zExclude);
735735
zKey = blob_str(&cacheKey);
736
+ etag_check(ETAG_HASH, zKey);
736737
737738
if( P("debug")!=0 ){
738739
style_header("Tarball Generator Debug Screen");
739740
@ zName = "%h(zName)"<br />
740741
@ rid = %d(rid)<br />
741742
--- src/tar.c
+++ src/tar.c
@@ -731,10 +731,11 @@
731 blob_appendf(&cacheKey, "/tarball/%z", rid_to_uuid(rid));
732 blob_appendf(&cacheKey, "/%q", zName);
733 if( zInclude ) blob_appendf(&cacheKey, ",in=%Q", zInclude);
734 if( zExclude ) blob_appendf(&cacheKey, ",ex=%Q", zExclude);
735 zKey = blob_str(&cacheKey);
 
736
737 if( P("debug")!=0 ){
738 style_header("Tarball Generator Debug Screen");
739 @ zName = "%h(zName)"<br />
740 @ rid = %d(rid)<br />
741
--- src/tar.c
+++ src/tar.c
@@ -731,10 +731,11 @@
731 blob_appendf(&cacheKey, "/tarball/%z", rid_to_uuid(rid));
732 blob_appendf(&cacheKey, "/%q", zName);
733 if( zInclude ) blob_appendf(&cacheKey, ",in=%Q", zInclude);
734 if( zExclude ) blob_appendf(&cacheKey, ",ex=%Q", zExclude);
735 zKey = blob_str(&cacheKey);
736 etag_check(ETAG_HASH, zKey);
737
738 if( P("debug")!=0 ){
739 style_header("Tarball Generator Debug Screen");
740 @ zName = "%h(zName)"<br />
741 @ rid = %d(rid)<br />
742
+1
--- src/zip.c
+++ src/zip.c
@@ -932,10 +932,11 @@
932932
blob_appendf(&cacheKey, "/%s/%z", g.zPath, rid_to_uuid(rid));
933933
blob_appendf(&cacheKey, "/%q", zName);
934934
if( zInclude ) blob_appendf(&cacheKey, ",in=%Q", zInclude);
935935
if( zExclude ) blob_appendf(&cacheKey, ",ex=%Q", zExclude);
936936
zKey = blob_str(&cacheKey);
937
+ etag_check(ETAG_HASH, zKey);
937938
938939
if( P("debug")!=0 ){
939940
style_header("%s Archive Generator Debug Screen", zType);
940941
@ zName = "%h(zName)"<br />
941942
@ rid = %d(rid)<br />
942943
--- src/zip.c
+++ src/zip.c
@@ -932,10 +932,11 @@
932 blob_appendf(&cacheKey, "/%s/%z", g.zPath, rid_to_uuid(rid));
933 blob_appendf(&cacheKey, "/%q", zName);
934 if( zInclude ) blob_appendf(&cacheKey, ",in=%Q", zInclude);
935 if( zExclude ) blob_appendf(&cacheKey, ",ex=%Q", zExclude);
936 zKey = blob_str(&cacheKey);
 
937
938 if( P("debug")!=0 ){
939 style_header("%s Archive Generator Debug Screen", zType);
940 @ zName = "%h(zName)"<br />
941 @ rid = %d(rid)<br />
942
--- src/zip.c
+++ src/zip.c
@@ -932,10 +932,11 @@
932 blob_appendf(&cacheKey, "/%s/%z", g.zPath, rid_to_uuid(rid));
933 blob_appendf(&cacheKey, "/%q", zName);
934 if( zInclude ) blob_appendf(&cacheKey, ",in=%Q", zInclude);
935 if( zExclude ) blob_appendf(&cacheKey, ",ex=%Q", zExclude);
936 zKey = blob_str(&cacheKey);
937 etag_check(ETAG_HASH, zKey);
938
939 if( P("debug")!=0 ){
940 style_header("%s Archive Generator Debug Screen", zType);
941 @ zName = "%h(zName)"<br />
942 @ rid = %d(rid)<br />
943

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button