Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvement: Cache / Speed #6

Open
lagoasoft-lucasschmidt opened this issue Nov 11, 2013 · 1 comment
Open

Improvement: Cache / Speed #6

lagoasoft-lucasschmidt opened this issue Nov 11, 2013 · 1 comment

Comments

@lagoasoft-lucasschmidt
Copy link

I`ve been thinking that it may be necessary to do some sort of caching of res.locals.js and res.locals.css.

Possibly res.locals.tmpl as well.

Here, in my branch, I did a cache of js/css, since thats what I am using.

https://github.com/lucastschmidt/cartero-express-hook/tree/cache_support

Do u guys have any interest in this feature to the library?

I specially needed this, since I added some extra stuff in other branches, and I have to use the file system quite often, to make sure the js/css files actually exist in the file system.

I ve been thinking that it may be better to change the entire code to async calls as well.

@go-oleg
Copy link
Contributor

go-oleg commented Nov 22, 2013

Hi @lucastschmidt,

Thanks for sharing this! It sounds like the js/css caching is very specific to your use case and probably isn't necessary for the general case since the contents of cartero.json are cached anyways.

".tmpl" files on the other hand are probably something we can cache so that they are not read from the file system every time. Since caching all of them could get pretty big though, we would want this to be an option into the middleware. At the same time, its pretty common to pre-compile templates into JavaScript when in production anyways, so this might not be a common use case.

I agree that we should make as much of the code async as possible.

Let use know if you want to open a PR for any of these things.

Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants