 
   redirectView: (request, response) =>
     responseCallback = createRedirectCallback response
-    @_convert request, responseCallback+    @_convert request, responseCallback

  createCache: (convertedFilename, conversionParams, callback) =>
    filepath = @_getCacheName conversionParams
    input = fs.createReadStream convertedFilename
    input.on "error", (err) =>
      console.log "Read stream error: #{err}"
    output = fs.createWriteStream filepath
    input.pipe output
    input.on "end", =>
      callback null, @_getLocation conversionParams

createPreloadCallback = (response) ->
  responseCallback = (headers, content, code) ->

      return
    fs.stat tempname, (statErr, stats) =>
      if statErr
        callback {data: ["Failed to read the converted file name.", 500], headers: {}}
        fs.unlink tempname, (err_unlink) =>
          if err_unlink
            @log.warn "Failed to unlink file on stat error #{tempname}: #{err_unlink}"
          else
            @log.debug "Unlinked on stat error #{tempname}."
        return
      cacheInstance.createCache tempname, (err, location) =>
        fs.unlink tempname, (err_unlink) =>
          if err_unlink
            @log.warn "Failed to unlink file #{tempname}: #{err_unlink}"
          else
            @log.debug "Unlinked #{tempname}."
        if err
          callback {data: ["Failed to create a cache instance.", 503], headers: {}}
        else
          callback {data: ["Go to #{location}", 302], headers: {"location": location}}

  _conversionDone: (err, cacheInstance, tempname) =>
    if err
