TypeError:对象不是一个函数+ nodeJS

我正在学习节点js使用在线课程,跟着video,但我在terminal得到这个错误:

  TypeError:对象不是一个函数
     在cacheYEntrega(C:\ Users \ omex \ Documents \ My Web Sites \ cache \ server.js:24:14)
     在C:\ Users \ omex \ Documents \ My Web Sites \ cache \ server.js:31:13
     在Object.cb [ascomcomplete](fs.js:168:19)
var http = require('http'); var path = require('path'); var fs = require('fs'); var mymeTypes = { '.js': 'text/javascript', '.html': 'text/html', '.css': 'text/css' }; var cache = {}; //objeto cache que se utilizara para almacenar archivos en memoria function cacheYEntrega(f,cb){ if(!cache[f]){ fs.readFile(f, function (err, data) { if (!err) { cache[f] = { content: data }; } cb(err, data); }); return; } console.log('cargando ' + f + ' de cache'); cb(null, cache(f).content); } http.createServer(function (request, response) { var buscar = path.basename(decodeURI(request.url)) || 'index.html', f = 'content/' + buscar; fs.exists(f, function (exists) { if (exists) { cacheYEntrega(f, function (err, data) { if (err) { response.writeHead(505); reponse.end('Error en el servidor'); return; } var headers = { 'Content-type': mymeTypes[path.extname(buscar)] }; response.writeHead(200, headers); response.end(data); }); return; } response.writeHead(404); response.end('pagina no encontrada'); }); }).listen(process.env.PORT || 8080); 

错误的原因是cache(f)需要cache[f] ,因为它是一个普通的对象,而不是一个函数。