1

As I was writing my initial question I saw this post.

I deployed my site and enabled static content compression. But still received the following response.

1st Run 1st Run

2nd Run 2nd Run

I can obviously see that the response size has decreased. This might be a stupid question, but its just to satisfy my own curiosity. If the content is compressed why would it show up as uncompressed in fiddler?

Fiddler - No Compression

EDIT: ..and can the content be gzipped on the first request as well?

UPDATE: I solved my issue by using deflate instead of gzip... go figgure :/ (and by comparing, apples with apples, and not 401 errors.) Thanks for all the comments though. Also i found the answer to the 401 errors i was receiving : Link

Community
  • 1
  • 1
Rohan Büchner
  • 5,333
  • 4
  • 62
  • 106

3 Answers3

4

The second response has the status code 401. I doubt it contains the actual content of the javascript, rather these 341 bytes are the error response sent from the server.

Wiktor Zychla
  • 47,367
  • 6
  • 74
  • 106
  • Within the first run image there is a 401 reponse two lines above the highlighted line that is the same as the highlighted line on the second image. So on the first run it seems initallly to throw a 401 for that file and then a returns a 200 – Nicholas Murray Jan 19 '12 at 09:22
  • Right and it seems then that he's trying to compare two different server outputs. – Wiktor Zychla Jan 19 '12 at 09:40
2

If the content is compressed why would it show up as uncompressed in fiddler?

Because Fiddler understands compression and automatically decompresses the output for your own convenience in order to display it in a friendly manner. The same way plugins such as FireBug and developer toolbars in browsers do. But what is actually sent on the wire is a gzip compressed content.

Darin Dimitrov
  • 1,023,142
  • 271
  • 3,287
  • 2,928
2

What is happening is that (as per my comments under Wiktors answer) is that you are not comparing like with like.

Your initial request to resource jquery.jGrid.src.js is generating a 401 Unauthorized error which then leads to your browser renegotiating the request with the server with the correct credientals, which then leads to the resource to be returned with a status code of 200 OK

Nicholas Murray
  • 13,305
  • 14
  • 65
  • 84