comparison src/cjr_print.sml @ 1818:e6ff36097cc4

Fixed HTTP date format and added Cache-Control to app.js
author Vladimir Shabanov <vshabanoff@gmail.com>
date Wed, 12 Sep 2012 19:49:02 +0400
parents 3d922a28370b
children 16b08de04f05
comparison
equal deleted inserted replaced
1814:2d9f831d45c9 1818:e6ff36097cc4
3237 3237
3238 val onError = ListUtil.search (fn (DOnError n, _) => SOME n | _ => NONE) ds 3238 val onError = ListUtil.search (fn (DOnError n, _) => SOME n | _ => NONE) ds
3239 3239
3240 val now = Time.now () 3240 val now = Time.now ()
3241 val nowD = Date.fromTimeUniv now 3241 val nowD = Date.fromTimeUniv now
3242 val rfcFmt = "%a, %d %b %Y %H:%M:%S" 3242 val rfcFmt = "%a, %d %b %Y %H:%M:%S GMT"
3243 in 3243 in
3244 box [string "#include \"", 3244 box [string "#include \"",
3245 string (OS.Path.joinDirFile {dir = !Settings.configInclude, 3245 string (OS.Path.joinDirFile {dir = !Settings.configInclude,
3246 file = "config.h"}), 3246 file = "config.h"}),
3247 string "\"", 3247 string "\"",
3427 newline, 3427 newline,
3428 newline, 3428 newline,
3429 string "uw_write_header(ctx, \"Content-type: text/javascript\\r\\n\");", 3429 string "uw_write_header(ctx, \"Content-type: text/javascript\\r\\n\");",
3430 newline, 3430 newline,
3431 string ("uw_write_header(ctx, \"Last-modified: " ^ Date.fmt rfcFmt nowD ^ "\\r\\n\");"), 3431 string ("uw_write_header(ctx, \"Last-modified: " ^ Date.fmt rfcFmt nowD ^ "\\r\\n\");"),
3432 newline,
3433 string ("uw_write_header(ctx, \"Cache-Control: max-age=31536000, public\\r\\n\");"),
3432 newline, 3434 newline,
3433 string "uw_write(ctx, jslib);", 3435 string "uw_write(ctx, jslib);",
3434 newline, 3436 newline,
3435 string "return;", 3437 string "return;",
3436 newline], 3438 newline],