Fossil SCM
Enable ETag caching of the /uvlist and /juvlist pages.
Commit
a6003f1df0f905ac2758f5464ac819a064470d226962eb9e904de372781661ca
Parent
261052c4e1c904d…
3 files changed
+2
-2
+1
-1
+2
+2
-2
| --- src/cgi.c | ||
| +++ src/cgi.c | ||
| @@ -174,12 +174,12 @@ | ||
| 174 | 174 | } |
| 175 | 175 | |
| 176 | 176 | /* |
| 177 | 177 | ** Additional information used to form the HTTP reply |
| 178 | 178 | */ |
| 179 | -static const char *zContentType = "text/html"; /* Content type of the reply */ | |
| 180 | -static const char *zReplyStatus = "OK"; /* Reply status description */ | |
| 179 | +static const char *zContentType = "text/html"; /* Content type of the reply */ | |
| 180 | +static const char *zReplyStatus = "OK"; /* Reply status description */ | |
| 181 | 181 | static int iReplyStatus = 200; /* Reply status code */ |
| 182 | 182 | static Blob extraHeader = BLOB_INITIALIZER; /* Extra header text */ |
| 183 | 183 | static int rangeStart = 0; /* Start of Range: */ |
| 184 | 184 | static int rangeEnd = 0; /* End of Range: plus 1 */ |
| 185 | 185 | |
| 186 | 186 |
| --- src/cgi.c | |
| +++ src/cgi.c | |
| @@ -174,12 +174,12 @@ | |
| 174 | } |
| 175 | |
| 176 | /* |
| 177 | ** Additional information used to form the HTTP reply |
| 178 | */ |
| 179 | static const char *zContentType = "text/html"; /* Content type of the reply */ |
| 180 | static const char *zReplyStatus = "OK"; /* Reply status description */ |
| 181 | static int iReplyStatus = 200; /* Reply status code */ |
| 182 | static Blob extraHeader = BLOB_INITIALIZER; /* Extra header text */ |
| 183 | static int rangeStart = 0; /* Start of Range: */ |
| 184 | static int rangeEnd = 0; /* End of Range: plus 1 */ |
| 185 | |
| 186 |
| --- src/cgi.c | |
| +++ src/cgi.c | |
| @@ -174,12 +174,12 @@ | |
| 174 | } |
| 175 | |
| 176 | /* |
| 177 | ** Additional information used to form the HTTP reply |
| 178 | */ |
| 179 | static const char *zContentType = "text/html"; /* Content type of the reply */ |
| 180 | static const char *zReplyStatus = "OK"; /* Reply status description */ |
| 181 | static int iReplyStatus = 200; /* Reply status code */ |
| 182 | static Blob extraHeader = BLOB_INITIALIZER; /* Extra header text */ |
| 183 | static int rangeStart = 0; /* Start of Range: */ |
| 184 | static int rangeEnd = 0; /* End of Range: plus 1 */ |
| 185 | |
| 186 |
+1
-1
| --- src/etag.c | ||
| +++ src/etag.c | ||
| @@ -98,11 +98,11 @@ | ||
| 98 | 98 | md5sum_step_text("\n", 1); |
| 99 | 99 | iMaxAge = 60; |
| 100 | 100 | }else if( eFlags & ETAG_CONFIG ){ |
| 101 | 101 | int iKey = db_int(0, "SELECT value FROM config WHERE name='cfgcnt'"); |
| 102 | 102 | sqlite3_snprintf(sizeof(zBuf),zBuf,"%d",iKey); |
| 103 | - md5sum_step_text("data: ", -1); | |
| 103 | + md5sum_step_text("config: ", -1); | |
| 104 | 104 | md5sum_step_text(zBuf, -1); |
| 105 | 105 | md5sum_step_text("\n", 1); |
| 106 | 106 | iMaxAge = 3600; |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 |
| --- src/etag.c | |
| +++ src/etag.c | |
| @@ -98,11 +98,11 @@ | |
| 98 | md5sum_step_text("\n", 1); |
| 99 | iMaxAge = 60; |
| 100 | }else if( eFlags & ETAG_CONFIG ){ |
| 101 | int iKey = db_int(0, "SELECT value FROM config WHERE name='cfgcnt'"); |
| 102 | sqlite3_snprintf(sizeof(zBuf),zBuf,"%d",iKey); |
| 103 | md5sum_step_text("data: ", -1); |
| 104 | md5sum_step_text(zBuf, -1); |
| 105 | md5sum_step_text("\n", 1); |
| 106 | iMaxAge = 3600; |
| 107 | } |
| 108 | |
| 109 |
| --- src/etag.c | |
| +++ src/etag.c | |
| @@ -98,11 +98,11 @@ | |
| 98 | md5sum_step_text("\n", 1); |
| 99 | iMaxAge = 60; |
| 100 | }else if( eFlags & ETAG_CONFIG ){ |
| 101 | int iKey = db_int(0, "SELECT value FROM config WHERE name='cfgcnt'"); |
| 102 | sqlite3_snprintf(sizeof(zBuf),zBuf,"%d",iKey); |
| 103 | md5sum_step_text("config: ", -1); |
| 104 | md5sum_step_text(zBuf, -1); |
| 105 | md5sum_step_text("\n", 1); |
| 106 | iMaxAge = 3600; |
| 107 | } |
| 108 | |
| 109 |
+2
| --- src/unversioned.c | ||
| +++ src/unversioned.c | ||
| @@ -524,10 +524,11 @@ | ||
| 524 | 524 | int showDel = 0; |
| 525 | 525 | char zSzName[100]; |
| 526 | 526 | |
| 527 | 527 | login_check_credentials(); |
| 528 | 528 | if( !g.perm.Read ){ login_needed(g.anon.Read); return; } |
| 529 | + etag_check(ETAG_DATA,0); | |
| 529 | 530 | style_header("Unversioned Files"); |
| 530 | 531 | if( !db_table_exists("repository","unversioned") ){ |
| 531 | 532 | @ No unversioned files on this server |
| 532 | 533 | style_footer(); |
| 533 | 534 | return; |
| @@ -636,10 +637,11 @@ | ||
| 636 | 637 | Blob json; |
| 637 | 638 | |
| 638 | 639 | login_check_credentials(); |
| 639 | 640 | if( !g.perm.Read ){ login_needed(g.anon.Read); return; } |
| 640 | 641 | cgi_set_content_type("text/json"); |
| 642 | + etag_check(ETAG_DATA,0); | |
| 641 | 643 | if( !db_table_exists("repository","unversioned") ){ |
| 642 | 644 | blob_init(&json, "[]", -1); |
| 643 | 645 | cgi_set_content(&json); |
| 644 | 646 | return; |
| 645 | 647 | } |
| 646 | 648 |
| --- src/unversioned.c | |
| +++ src/unversioned.c | |
| @@ -524,10 +524,11 @@ | |
| 524 | int showDel = 0; |
| 525 | char zSzName[100]; |
| 526 | |
| 527 | login_check_credentials(); |
| 528 | if( !g.perm.Read ){ login_needed(g.anon.Read); return; } |
| 529 | style_header("Unversioned Files"); |
| 530 | if( !db_table_exists("repository","unversioned") ){ |
| 531 | @ No unversioned files on this server |
| 532 | style_footer(); |
| 533 | return; |
| @@ -636,10 +637,11 @@ | |
| 636 | Blob json; |
| 637 | |
| 638 | login_check_credentials(); |
| 639 | if( !g.perm.Read ){ login_needed(g.anon.Read); return; } |
| 640 | cgi_set_content_type("text/json"); |
| 641 | if( !db_table_exists("repository","unversioned") ){ |
| 642 | blob_init(&json, "[]", -1); |
| 643 | cgi_set_content(&json); |
| 644 | return; |
| 645 | } |
| 646 |
| --- src/unversioned.c | |
| +++ src/unversioned.c | |
| @@ -524,10 +524,11 @@ | |
| 524 | int showDel = 0; |
| 525 | char zSzName[100]; |
| 526 | |
| 527 | login_check_credentials(); |
| 528 | if( !g.perm.Read ){ login_needed(g.anon.Read); return; } |
| 529 | etag_check(ETAG_DATA,0); |
| 530 | style_header("Unversioned Files"); |
| 531 | if( !db_table_exists("repository","unversioned") ){ |
| 532 | @ No unversioned files on this server |
| 533 | style_footer(); |
| 534 | return; |
| @@ -636,10 +637,11 @@ | |
| 637 | Blob json; |
| 638 | |
| 639 | login_check_credentials(); |
| 640 | if( !g.perm.Read ){ login_needed(g.anon.Read); return; } |
| 641 | cgi_set_content_type("text/json"); |
| 642 | etag_check(ETAG_DATA,0); |
| 643 | if( !db_table_exists("repository","unversioned") ){ |
| 644 | blob_init(&json, "[]", -1); |
| 645 | cgi_set_content(&json); |
| 646 | return; |
| 647 | } |
| 648 |