I have a node app running my blog and my content is coming from an outside api. I use express
and currently with dust
templates and by default views are cached. However apparently there is no way to clear the cached files without restarting node.
Is it normal that when I update a blogpost I restart node or am I doing something wrong?
I have a webhook, so I can act on the content change, I just don't know what I would correctly do.
if your blog post are stored inside a database, express will only cache you html template but will populate your views with the information. if your blogposts are new ht;l page each time, I think you will need to restart your nodejs server. But in your express configuration (template configuration I think) you have an option to deactivate the cache. And/Or you can use pm2 or nodemon to restart your nodejs on every changes (not really the best way)
PS: oups talk to much about different way, forget you have the content from an API. So I think you can remove your cache on dust. The only time I restart nodejs is when I update the javascript/nodejs code.