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

now.js transferred as 'text/plain'? #18

Closed
leiwan5 opened this issue Mar 20, 2011 · 5 comments
Closed

now.js transferred as 'text/plain'? #18

leiwan5 opened this issue Mar 20, 2011 · 5 comments

Comments

@leiwan5
Copy link

leiwan5 commented Mar 20, 2011

I'm using firefox 4.0rc2. A warning "Resource interpreted as Script but transferred with MIME type text/plain." triggered when loading now.js.

@leiwan5
Copy link
Author

leiwan5 commented Mar 20, 2011

sorry, it's chrome 10, not firefox

@sridatta
Copy link
Contributor

Thanks for letting us know. It's added to the list of bugs to fix.

@dvv
Copy link

dvv commented Mar 20, 2011

Frankly, there should be an option to relay serving static files to an external app (nginx?) or a middleware layer -- to say, to the code which is capable of setting etags,cache-control and so on.

For setting SERVER and PORT is in essense the same as the rendering a template, right?

@ericz
Copy link
Contributor

ericz commented Mar 21, 2011

now.js content-type 'text/plain' has been changed to 'text/javascript'

This issue is now fixed.

@dvv, we set SERVER and PORT on first request of now.js, then we cache it since it will never change in the lifetime of the service instance.
If you prefer to serve it statically using nginx etc. , simply download http://localhost:port/socket.io/socket.io.js and http://localhost:port/nowjs/now.js. Since that now.js will have the server and port already filled out, you can serve that static file without issue.

@ericz ericz closed this as completed Mar 21, 2011
@dvv
Copy link

dvv commented Mar 21, 2011

This still leaves unnecessary checks for certain URLs ('/nowjs/now.js') in request handlers in setups like mine where dynamic handlers stand before static ones. I mostly meant elimination of these checks. The same in socket-io itself about checking whether url is /socket.io/socket.io.js which is not switchable out and just eats ticks...

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

4 participants