Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

whitelist/blacklist views for caching #792

Closed
mahemoff opened this Issue · 10 comments

4 participants

Michael Mahemoff TJ Holowaychuk Mike P kaven276
Michael Mahemoff

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)

TJ Holowaychuk
tj commented

in production they are all cached (and should be)

Michael Mahemoff

Thanks.

Michael Mahemoff mahemoff closed this
Mike P

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.

TJ Holowaychuk
tj commented

@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

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

kaven276

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

TJ Holowaychuk
tj commented

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

kaven276

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.

kaven276

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...

TJ Holowaychuk
tj commented

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.