Rohan Büchner
Rohan Büchner

Reputation: 5393

Is the static content (eg: .css, .js), sent from my server being gzipped?

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

Upvotes: 1

Views: 210

Answers (3)

Nicholas Murray
Nicholas Murray

Reputation: 13533

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

Upvotes: 2

Darin Dimitrov
Darin Dimitrov

Reputation: 1038940

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.

Upvotes: 2

Wiktor Zychla
Wiktor Zychla

Reputation: 48250

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.

Upvotes: 4

Related Questions