0

Node.js keeps on using a cached version of my website. I updated the code and even used the -w option, but Forever keeps on referring to the cache. How do I disable caching with Forever Node.js and also how do I completely uninstall it?

According to this answer, it does cache: https://serverfault.com/questions/320973/does-the-forever-daemon-cache-the-node-js-script

Edit: It seems that this is a persistent issue with Forever: https://github.com/foreverjs/forever/issues/590

Community
  • 1
  • 1
Soubriquet
  • 3,100
  • 10
  • 37
  • 52
  • Are you sure Forever is the culprit? What happens when you start up your server just using 'node app.js' (or whatever your entry script is called)? – HeadCode Jan 08 '15 at 23:42
  • what do you mean by cache? can you be more specific about the behavior causing issues? – dandavis Jan 08 '15 at 23:42
  • @HeadCode when I start the app with `node server.js`, everything works fine. I'm sure Forever is caching it. I ran in this problem yesterday and resolved the issue with the `-w` option, but that isn't working now. No idea why. – Soubriquet Jan 08 '15 at 23:45
  • @JonathanLonowski Yeah, I tried both `forever stop` `forever restart`. Neither fix the issue. – Soubriquet Jan 08 '15 at 23:50
  • You've probably tried this, but do you get anything when you run 'forever list' even after killing forever? – HeadCode Jan 09 '15 at 00:16
  • @HeadCode After killing forever, `forever list` shows that nothing is running. – Soubriquet Jan 09 '15 at 00:17
  • Does anyone know a better way than forever to run multiple node.js apps? – Soubriquet Jan 09 '15 at 00:19
  • You could always blow away the '.forever' directory in your home directory and see what happens. Make sure you have caching turned off in your browser as well. – HeadCode Jan 09 '15 at 00:20
  • 1
    @Soubriquet If `forever list` is empty, then your script may not have been started by `forever`. You may need to find and kill the persistent `node` process yourself ([with `ps` and `kill`](http://stackoverflow.com/questions/3510673/find-and-kill-a-process-in-one-line-using-bash-and-regex) or Task Manager in Windows). Also note that the caching of code is [managed by `node`](http://nodejs.org/api/modules.html#modules_caching) and can't be disabled. It'll keep in memory the result of each file it evaluates until the process is terminated. – Jonathan Lonowski Jan 09 '15 at 00:25
  • @HeadCode I just tried your suggestion and then reinstalled forever, but the issue is persisting. – Soubriquet Jan 09 '15 at 00:31
  • @JonathanLonowski I also tried that and nothing changed. :/ – Soubriquet Jan 09 '15 at 00:31

1 Answers1

0

I don't know if it's still actual but restarting forever will help.

vre2h
  • 88
  • 3