-
-
Save Raynos/1231896 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dexter_e> Is there a way to limit Static file match attempts to a certain directory like /static/ ? | |
[6:33 PM] ⇐ fatjonny ([email protected]) quit: Ping timeout: 252 seconds | |
[6:34 PM] <tjholowaychuk> dexter_e use('/static', express.static('static')) | |
[6:34 PM] <tjholowaychuk> that /static can be whatever you want though | |
[6:34 PM] <tjholowaychuk> /public etc | |
[6:34 PM] <dexter_e> and then all other static file load attempts will be ignored ? | |
[6:34 PM] <dexter_e> ( if they don't match any other routes ) | |
[6:35 PM] <tjholowaychuk> yeah | |
[6:35 PM] <dexter_e> Sweet! Thanks! | |
[6:35 PM] <dexter_e> I had one more question about Caching.. Is the cashe reset upon restart ? | |
[6:36 PM] <dexter_e> And do you recommend using NGINX or some kind of proxy in front of express for caching or do you think its OK to just roll with Node front and center ? | |
[6:37 PM] ⇐ bombworm ([email protected]) quit | |
[6:38 PM] <tjholowaychuk> staticCache? | |
[6:38 PM] <tjholowaychuk> yeah it's in memory | |
[6:38 PM] <tjholowaychuk> so on restart it's gone | |
[6:38 PM] <dexter_e> I see | |
[6:38 PM] <tjholowaychuk> we run node on port 80 so no nginx etc but it really depends on what you need | |
[6:39 PM] <dexter_e> well, don't we all need the same thing? :) | |
[6:39 PM] <dexter_e> speed, reliability, simplicity, flexibility n stuff.. | |
[6:39 PM] <dexter_e> :p | |
[6:40 PM] → fatjonny ([email protected]) joined | |
[6:41 PM] <nibblebot> tjholowaychuk: are you considering different logic for respawning workers in cluster? right now it will just respawn forever which locks up resources, pollutes error logs | |
[6:41 PM] <tjholowaychuk> not really haha, depends on your entire set up, if you need "virtual hosts" etc, node isn't the fastest thing for file serving | |
[6:41 PM] <tjholowaychuk> but the memory cache helps a lot | |
[6:41 PM] <tjholowaychuk> though if you're in production you most likely use a CDN anyway | |
[6:42 PM] <tjholowaychuk> nibblebot it should catch cyclic spawning | |
[6:42 PM] <tjholowaychuk> cant remember if i have it configurable or not | |
[6:42 PM] <nibblebot> it does for master restarting | |
[6:42 PM] <nibblebot> but not workers | |
[6:42 PM] <tjholowaychuk> ah | |
[6:46 PM] <dexter_e> In context of Express is there a recommended strategy for static files in the CDN? | |
[6:47 PM] <tjholowaychuk> not really, same as any other framework i suppose | |
[6:47 PM] <tjholowaychuk> nothing really framework specific about it | |
[6:47 PM] <dexter_e> Prepend base url at runtime ? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment