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

Client library is sent without cache headers #903

Closed
Znarkus opened this issue May 30, 2012 · 3 comments
Closed

Client library is sent without cache headers #903

Znarkus opened this issue May 30, 2012 · 3 comments

Comments

@Znarkus
Copy link
Contributor

Znarkus commented May 30, 2012

<script src="/socket.io/socket.io.js"></script> this Javascript file is sent to the client without cache headers (ETag, Last-Modified etc).

Since this is quite large (70kB), it would be nice to allow the clients to cache it. Or is there a reason this isn't done?

Also: Would be nice if the docs said something about that it magically creates a route for this file. :)

@3rd-Eden
Copy link
Contributor

There is a wiki on how to configure socket.io and its cache headers,

Same goes for the magic route

Sent from my iPhone

On 30 mei 2012, at 23:30, Markus Hedlundreply@reply.github.com wrote:

<script src="/socket.io/socket.io.js"></script> this Javascript file is sent to the client without cache headers (ETag, Last-Modified etc).

Since this is quite large (70kB), it would be nice to allow the clients to cache it. Or is there a reason this isn't done?

Also: Would be nice if the docs said something about that it magically creates a route for this file. :)


Reply to this email directly or view it on GitHub:
#903

@Znarkus
Copy link
Contributor Author

Znarkus commented May 31, 2012

For anyone else with the same issue:

Wiki: https://github.com/LearnBoost/Socket.IO/wiki/Configuring-Socket.IO

Code:

io.enable('browser client minification');  // send minified client
io.enable('browser client etag');          // apply etag caching logic based on version number
io.enable('browser client gzip');          // gzip the file
io.set('log level', 1);                    // reduce logging
io.set('transports', [                     // enable all transports (optional if you want flashsocket)
    'websocket'
  , 'flashsocket'
  , 'htmlfile'
  , 'xhr-polling'
  , 'jsonp-polling'
]);

@Znarkus Znarkus closed this as completed May 31, 2012
@rauchg
Copy link
Contributor

rauchg commented May 31, 2012

The docs are in the wiki. There's production settings you can enable to
ensure the file is served like you suggest.

On Wed, May 30, 2012 at 4:30 PM, Markus Hedlund <
reply@reply.github.com

wrote:

<script src="/socket.io/socket.io.js"></script> this Javascript file is
sent to the client without cache headers (ETag, Last-Modified etc).

Since this is quite large (70kB), it would be nice to allow the clients to
cache it. Or is there a reason this isn't done?

Also: Would be nice if the docs said something about that it magically
creates a route for this file. :)


Reply to this email directly or view it on GitHub:
#903

Guillermo Rauch
LearnBoost CTO
http://devthought.com

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

3 participants