Fossil SCM

Cache the main.js file.

drh 2017-12-05 13:50 trunk
Commit 1760a15156df5260b0933a0a6a0e186e45336982183d5a1d673925485bdb96f2
1 file changed +5 -3
+5 -3
--- src/style.c
+++ src/style.c
@@ -682,11 +682,12 @@
682682
@ </script>
683683
684684
685685
zFooter = skin_get("footer");
686686
if( sqlite3_strlike("%</body>%", zFooter, 0)==0 ){
687
- @ <script src='%s(g.zBaseURL)/main.js' type='application/javascript'>\
687
+ @ <script src='%s(g.zBaseURL)/main.js/%S(MANIFEST_UUID)' \
688
+ @ type='application/javascript'></script>
688689
}
689690
if( g.thTrace ) Th_Trace("BEGIN_FOOTER<br />\n", -1);
690691
Th_Render(zFooter);
691692
if( g.thTrace ) Th_Trace("END_FOOTER<br />\n", -1);
692693
@@ -697,12 +698,12 @@
697698
cgi_append_content("</span>\n", -1);
698699
}
699700
700701
/* Add document end mark if it was not in the footer */
701702
if( sqlite3_strlike("%</body>%", zFooter, 0)!=0 ){
702
- @ <script src='%s(g.zBaseURL)/main.js' type='application/javascript'>\
703
- @ </script>
703
+ @ <script src='%s(g.zBaseURL)/main.js/%S(MANIFEST_UUID)' \
704
+ @ type='application/javascript'></script>
704705
@ </body>
705706
@ </html>
706707
}
707708
}
708709
@@ -845,10 +846,11 @@
845846
void page_main_js(void){
846847
Blob mainjs;
847848
cgi_set_content_type("application/javascript");
848849
blob_init(&mainjs, builtin_text("main.js"), -1);
849850
cgi_set_content(&mainjs);
851
+ g.isConst = 1;
850852
}
851853
852854
853855
/*
854856
** WEBPAGE: test_env
855857
--- src/style.c
+++ src/style.c
@@ -682,11 +682,12 @@
682 @ </script>
683
684
685 zFooter = skin_get("footer");
686 if( sqlite3_strlike("%</body>%", zFooter, 0)==0 ){
687 @ <script src='%s(g.zBaseURL)/main.js' type='application/javascript'>\
 
688 }
689 if( g.thTrace ) Th_Trace("BEGIN_FOOTER<br />\n", -1);
690 Th_Render(zFooter);
691 if( g.thTrace ) Th_Trace("END_FOOTER<br />\n", -1);
692
@@ -697,12 +698,12 @@
697 cgi_append_content("</span>\n", -1);
698 }
699
700 /* Add document end mark if it was not in the footer */
701 if( sqlite3_strlike("%</body>%", zFooter, 0)!=0 ){
702 @ <script src='%s(g.zBaseURL)/main.js' type='application/javascript'>\
703 @ </script>
704 @ </body>
705 @ </html>
706 }
707 }
708
@@ -845,10 +846,11 @@
845 void page_main_js(void){
846 Blob mainjs;
847 cgi_set_content_type("application/javascript");
848 blob_init(&mainjs, builtin_text("main.js"), -1);
849 cgi_set_content(&mainjs);
 
850 }
851
852
853 /*
854 ** WEBPAGE: test_env
855
--- src/style.c
+++ src/style.c
@@ -682,11 +682,12 @@
682 @ </script>
683
684
685 zFooter = skin_get("footer");
686 if( sqlite3_strlike("%</body>%", zFooter, 0)==0 ){
687 @ <script src='%s(g.zBaseURL)/main.js/%S(MANIFEST_UUID)' \
688 @ type='application/javascript'></script>
689 }
690 if( g.thTrace ) Th_Trace("BEGIN_FOOTER<br />\n", -1);
691 Th_Render(zFooter);
692 if( g.thTrace ) Th_Trace("END_FOOTER<br />\n", -1);
693
@@ -697,12 +698,12 @@
698 cgi_append_content("</span>\n", -1);
699 }
700
701 /* Add document end mark if it was not in the footer */
702 if( sqlite3_strlike("%</body>%", zFooter, 0)!=0 ){
703 @ <script src='%s(g.zBaseURL)/main.js/%S(MANIFEST_UUID)' \
704 @ type='application/javascript'></script>
705 @ </body>
706 @ </html>
707 }
708 }
709
@@ -845,10 +846,11 @@
846 void page_main_js(void){
847 Blob mainjs;
848 cgi_set_content_type("application/javascript");
849 blob_init(&mainjs, builtin_text("main.js"), -1);
850 cgi_set_content(&mainjs);
851 g.isConst = 1;
852 }
853
854
855 /*
856 ** WEBPAGE: test_env
857

Keyboard Shortcuts

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