SharePoint online Javascript CSOM no longer gzips responses?

# UPDATE 1 : This was due to BREACH, a hack which attacks compressed https traffic.

# UPDATE 2 : GZIP compression over https is BACK! (as of January 2014) … the mystery continues …

One of my favourite API’s in SharePoint is the Javascript CSOM (or, JSOM, as some refer to it). It’s certainly nicer to interact with that lists.asmx, or making calls directly to author.dll …

Unfortunately, there seems to be something mysterious going on with compression within SharePoint online.

The issue:

When you do an executeQueryAsync in javascript, your browser should automatically add a “Accept-Encoding: gzip, deflate, sdch” header to the request. This tells the server to zip up the response before it’s passed back.

Back in the day, SharePoint would accept this header correctly, and return a zipped response. Pretty handy when you are returning oodles of JSON. (Would be even handier if it also allowed you to submit a zipped POST – as compression would be even more awesome over oodles of XML … but, maybe a rant for another day).

This is what it used to look like: although the response is 2.8mbs, the server is only returning 120kb.


spo-what it should look like

Unfortunately, for some reason SharePoint online is no longer compressing its responses correctly.

So, now it looks more like this: a 40mb response to an executeQueryAsync is transferring the full 40mb. (What on earth do you have to do to get a 40mb response to ProcessQuery? Long story.)

spo-what it does look like

That’s pretty … frustrating.

Anyway – hopeful we see a fix / workaround soon. Seems pretty wasteful.


1 thought on “SharePoint online Javascript CSOM no longer gzips responses?

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s