Skip to content

Conversation

@sumitverma
Copy link
Contributor

Changes to make sure the server scope is not set until yui and less is instantiated.

@DominicWatson
Copy link
Contributor

I'm unsure of what this achieves. Is it to avoid multiple assignments to variables in the server scope? Is doing that a bad thing? I've no objection to the code in general, just curious to know the reasons behind it...

@sumitverma
Copy link
Contributor Author

Main reason is, if the yui or less object instantiation errors out, in current code, your server scope is already set as an empty struct. So, next request will skip the instantiation and error out on next line.

In general I think it will be better to keep in application scope instead of server, specially considering people use it on shared server. Some other application can muck with the variable causing other application to error.

@DominicWatson
Copy link
Contributor

That makes a lot of sense. I'll pull it in. Good point re shared hosting too. It's put in the server scope to avoid memory leak issues with JavaLoader and I think that should be the default place for it. There could be an option to cache it in scope of the CfStatic instance but I wouldn't want to cater for shared hosting by default (perhaps init arg of storeJavaLoadersInServerScope defaulted to true, or 'sharedHosting' defaulted to false).

DominicWatson added a commit that referenced this pull request Jan 26, 2012
Update org/cfstatic/CfStatic.cfc
@DominicWatson DominicWatson merged commit 0038df9 into teamcfadvance:master Jan 26, 2012
@DominicWatson
Copy link
Contributor

p.s. thanks for the contribution! really appreciated :)

@sumitverma
Copy link
Contributor Author

Thank you for the great app :) Giving the option to change the caching scope is great idea.

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

Successfully merging this pull request may close these issues.

2 participants