anchor.diff:      ok.
   
   outh_set_content_type(Mime) ->
  +    put(outh_mime_type, Mime),
       put(outh, (get(outh))#outh{content_type = make_content_type_header(Mime)}),
       ok.
   
  
positive.code:                                      end].
  
  make_last_modified_header(FI) ->
      N = element(2, now()),
      Inode = FI#file_info.inode,  %% unix only
      case get({last_modified, Inode}) of
          {Str, Secs} when N < (Secs+10) ->
              Str;
          _ ->
              S = do_make_last_modified(FI),
              put({last_modified, Inode}, {S, N}),
              S
      end.
  
  do_make_last_modified(FI) ->
      Then = FI#file_info.mtime,
      ["Last-Modified: ", local_time_as_gmt_string(Then), "\r\n"].
  
  
  make_expires_header(MimeType, FI) ->
      N = element(2, now()),
      case get({expire, MimeType}) of
          {Str, Secs} when N < (Secs+10) ->
              Str;
          _ ->
              SC = get(sc),
              case lists:keysearch(MimeType, 1, SC#sconf.expires) of
                  {value, {MimeType, Type, TTL}} ->
                      S1 = make_expires_header(Type, TTL, FI),
                      S2 = make_cache_control_header(TTL),
                      put({expire, MimeType}, {S1, N}),
                      put({cache_control, MimeType}, {S2, N}),
                      S1;
                  false ->
                      undefined
              end
      end.
  
  
  make_expires_header(access, TTL, _FI) ->
      DateTime = erlang:universaltime(),
      Secs = calendar:datetime_to_gregorian_seconds(DateTime) + TTL,
      ExpireTime = calendar:gregorian_seconds_to_datetime(Secs),
      ["Expires: ", universal_time_as_string(ExpireTime), "\r\n"];
  make_expires_header(modify, TTL, FI) ->
      DateTime = FI#file_info.mtime,
      Secs = calendar:datetime_to_gregorian_seconds(DateTime) + TTL,
      ExpireTime = calendar:gregorian_seconds_to_datetime(Secs),
      ["Expires: ", local_time_as_gmt_string(ExpireTime), "\r\n"].
  
  
  make_cache_control_header(MimeType, FI) ->
      N = element(2, now()),
      case get({cache_control, MimeType}) of
          {Str, Secs} when N < (Secs+10) ->
              Str;
          _ ->
              SC = get(sc),
              case lists:keysearch(MimeType, 1, SC#sconf.expires) of
                  {value, {MimeType, Type, TTL}} ->
                      S1 = make_cache_control_header(TTL),
                      S2 = make_expires_header(Type, TTL, FI),
                      put({cache_control, MimeType}, {S1, N}),
                      put({expire, MimeType}, {S2, N}),
                      S1;
                  false ->
                      undefined
              end
      end.
  
  
  make_cache_control_header(TTL) ->
      ["Cache-Control: ", "max-age=", erlang:integer_to_list(TTL), "\r\n"].
  
  
  make_location_header(Where) ->
  
negative.code:            doclose           = DoClose,
             contlen           = Length
            },
      %% store finfo to set last_modified, expires and cache_control headers
      %% during #outh{} serialization.
      put(file_info, UT#urltype.finfo),
      put(outh, H2).
  
  outh_set_304_headers(Req, UT, Headers) ->
  