diff options
author | 2011-08-19 08:59:01 -0400 | |
---|---|---|
committer | 2011-08-19 08:59:01 -0400 | |
commit | 4566f7c929223345423d66554be1015acf3cefb9 (patch) | |
tree | 590cf1011292fdf19844803e40b034f3970d5161 /src/cjr_print.sml | |
parent | 3be0c7ef9d8ed5606b4f82940b333f5f4045e1f0 (diff) |
Add timestamps to 'app.js' filenames, to prevent inappropriate caching by browsers
Diffstat (limited to 'src/cjr_print.sml')
-rw-r--r-- | src/cjr_print.sml | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/cjr_print.sml b/src/cjr_print.sml index cfe8ee13..159948b3 100644 --- a/src/cjr_print.sml +++ b/src/cjr_print.sml @@ -2637,6 +2637,10 @@ fun p_file env (ds, ps) = newline] end + val timestamp = LargeInt.toString (Time.toMilliseconds (Time.now ())) + val app_js = OS.Path.joinDirFile {dir = Settings.getUrlPrefix (), + file = "app." ^ timestamp ^ ".js"} + fun p_page (ek, s, n, ts, ran, side, tellSig) = let val (ts, defInputs, inputsVar, fields) = @@ -2756,8 +2760,7 @@ fun p_file env (ds, ps) = let val scripts = "<script type=\\\"text/javascript\\\" src=\\\"" - ^ OS.Path.joinDirFile {dir = Settings.getUrlPrefix (), - file = "app.js"} + ^ app_js ^ "\\\"></script>\\n" in foldl (fn (x, scripts) => @@ -3117,8 +3120,7 @@ fun p_file env (ds, ps) = string "static void uw_handle(uw_context ctx, char *request) {", newline, string "if (!strcmp(request, \"", - string (OS.Path.joinDirFile {dir = Settings.getUrlPrefix (), - file = "app.js"}), + string app_js, string "\")) {", newline, box [string "uw_Basis_string ims = uw_Basis_requestHeader(ctx, \"If-modified-since\");", |