whitelist/blacklist views for caching #792

Closed
mahemoff opened this Issue Aug 3, 2011 · 10 comments

Comments

Projects
None yet
4 participants

mahemoff commented Aug 3, 2011

Is it possible to choose which views are cached, or will Express just cache them all?

(context http://stackoverflow.com/questions/6917009/caching-in-node-express-how-do-you-whitelist-blacklist-views)

Owner

tj commented Aug 3, 2011

in production they are all cached (and should be)

mahemoff commented Aug 3, 2011

Thanks.

mahemoff closed this Aug 3, 2011

mypark commented Aug 14, 2011

New to express and node so not sure if this is an obvious question but, what is the cache duration, can you adjust per page? I.e. a "my profile" page should not be cached for everyone, and have a shorter cache duration then say a home page which should be cached for everyone and for a longer period of time, especially if it involves a lot of expensive db queries.

Owner

tj commented Aug 15, 2011

@mypark express doesn't cache contents, just the compiled view template, meaning only the function used to generate the html, but not the html itself

kaven276 commented Oct 9, 2011

In production env, if the view-source is modified, the cached compiled function should be recompiled to.

kaven276 commented Oct 9, 2011

so no mater of env is prod or dev, express should LRU cache the compiled fn, and detect change and recompile,
so no option is needed

Owner

tj commented Oct 9, 2011

I dont hate the idea, but IMO it's inevitable that you'll restart, and in practice it's pretty rare that you'll change a few templates and nothing else in your application

I always update oracle's plsql stored procedure just for small changes,
when I test the update in deveploment env, I just update to production db,
You do not need to close oracle and then update plsql, oracle is just running, and you update plsql sp,
oracle known the object dependency and recompile views/storeprocedures when the next reference to them
I's very convienient, so I just want a hot-updatable node server.
If all data and code are in the dependency management, we donnot need cache options, if no change, just cache, if memory is lack, just use LRU to release some mem. just like oracle db do.

oracle is a server who can cache/buffer everything(data,code) for efficiency, and automatically manage object dependeny for hot update, so oracle is used in lots of vital production env.
If node can do the same things, It's a robust server too, and do better than other server like PHP,ruby...

Owner

tj commented Oct 11, 2011

sure, I guess, but I wont believe it until I see it, and tackling one small portion of an app doesn't solve the problem. I've seen many bad attempts at hot-reloading for node apps so I'm not convinced yet

dougwilson locked and limited conversation to collaborators Apr 10, 2015

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.