There’s a lot better with the new setup – we aren’t kidding when we say this is a big change. Read on for more details about how pusher-js is getting better:
Bandwidth savings with gzip
- 50-60% less bandwidth used to fetch minified files
- faster page loads
- improved initial connection time, especially when using HTTP fallbacks
- better battery usage on mobile devices
- no extra warnings from PageSpeed
Browsers which don’t want to receive compressed content will be served uncompressed versions of files.
No need for the second domain
Having to switch between HTTP/HTTPS domains is very frustrating, but you can now use
js.pusher.com for both encrypted and unencrypted transmissions. Since all major browsers support schema-less URL’s, there’s no need for conditionals:
This way browsers will use the same protocol for the document and pusher-js.
Proper CORS support
crossorigin attribute set. Some libraries (e.g. Polymer) set it for all resources.
In that scenario, modern browsers expect the
Access-Control-Allow-Origin response header to contain the origin hostname included in the request. When the
Origin request header is missing, the server should set the allowed hostname to
While this seems like a simple feature, it’s rarely supported by CDN providers – and now it’s no longer an issue. From now on,
js.pusher.com will always return the
Access-Control-Allow-Origin header correctly.
What do I need to do?
The only change that requires modifying code is migrating HTTPS requests to the new CDN: if you want to use
js.pusher.com with SSL, you’ll need to change URL’s in your applications. Otherwise, you don’t need to do anything – all the changes are already supported by