I am using the chrome extension YSlow to test my site performance.
I've got F Grade on Compress components with gzip.
There are 15 plain text components that should be sent compressed:
http://localhost:21964/Content/custom/css/blog.css
http://localhost:21964/Content/custom/css/style.css
http://localhost:21964/Content/custom/css/socialize-bookmarks.css
http://localhost:21964/Content/custom/css/prettyPhoto.css
http://localhost:21964/Content/custom/css/flexslider.css
http://localhost:21964/Content/custom/css/colors/color-orange.css
http://localhost:21964/Content/sc2.css
http://localhost:21964/Content/custom/javascript/custom.js
http://localhost:21964/Content/custom/javascript/header.js
http://localhost:21964/Content/custom/javascript/twitter.js
http://localhost:21964/Content/custom/javascript/bra.photostream.js
http://localhost:21964/Content/custom/javascript/jquery.flexslider.js
http://localhost:21964/Content/custom/javascript/jquery.bpopup-0.7.0.min.js
http://localhost:21964/Content/custom/javascript/prettyPhoto.js
http://localhost:21964/css/colors/color-orange.css
Compression reduces response times by reducing the size of the HTTP response. Gzip is the most popular and effective compression method currently available and generally reduces the response size by about 70%. Approximately 90% of today's Internet traffic travels through browsers that claim to support gzip.
There was a similar post here, But even though I've followed these steps it doesn't compress the traffic.
Steps I've done:
I ticked all the compression settings in the IIS -> Compression.
Activate the Windows Feature "Dynamic Content Compression".
I've added this lines to the web.config:
<system.webServer>
...
<httpCompression directory="%SystemDrive%\inetpub\temp\IIS Temporary Compressed Files">
<scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll"/>
<dynamicTypes>
<add mimeType="text/*" enabled="true"/>
<add mimeType="message/*" enabled="true"/>
<add mimeType="application/javascript" enabled="true"/>
<add mimeType="*/*" enabled="true"/>
</dynamicTypes>
<staticTypes>
<add mimeType="text/*" enabled="true"/>
<add mimeType="message/*" enabled="true"/>
<add mimeType="application/javascript" enabled="true"/>
<add mimeType="*/*" enabled="true"/>
</staticTypes>
</httpCompression>
<urlCompression doStaticCompression="true" doDynamicCompression="true" />
...
</system.webServer>
I am currently using the Developer Server inside the project Properties -> Web -> Servers
The visual studio development server (Cassini) doesn't support gzip compression use IIS or IIS Express.
Related
My hosting server is godaddy on a shared hosting environment.
Because of shared hosting environment I do not have access to IIS settings.
For many purposes I send json response to ajax request
I have set the following in my web.config file
<httpCompression directory="%SystemDrive%\inetpub\temp\IIS Temporary Compressed Files">
<scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll"/>
<dynamicTypes>
<add mimeType="text/*" enabled="true"/>
<add mimeType="message/*" enabled="true"/>
<add mimeType="application/javascript" enabled="true"/>
<add mimeType="application/json" enabled="true"/>
<add mimeType="*/*" enabled="false"/>
</dynamicTypes>
<staticTypes>
<add mimeType="text/*" enabled="true"/>
<add mimeType="message/*" enabled="true"/>
<add mimeType="application/javascript" enabled="true"/>
<add mimeType="application/json" enabled="true"/>
<add mimeType="*/*" enabled="false"/>
</staticTypes>
</httpCompression>
I can make my .aspx pages gziped but It is not compressing json responses.
How can I compress json responses..??
I think the answer is that you need your own VPS server (if you are on a budget) or your own dedicated server. Then you can modify the applicationHost.config for IIS7
I have enabled GZip compression via web.config with many helps from another question: Enable IIS7 gzip
I have tested the compression with Live HTTP Headers plugin in FF, and it correctly shows
Content-Encoding: gzip
I have added the following code to my web.config:
<system.webServer>
<httpCompression directory="%SystemDrive%\inetpub\temp\IIS Temporary Compressed Files">
<scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll"/>
<dynamicTypes>
<add mimeType="text/*" enabled="true"/>
<add mimeType="message/*" enabled="true"/>
<add mimeType="application/javascript" enabled="true"/>
<add mimeType="*/*" enabled="false"/>
</dynamicTypes>
<staticTypes>
<add mimeType="text/*" enabled="true"/>
<add mimeType="message/*" enabled="true"/>
<add mimeType="application/javascript" enabled="true"/>
<add mimeType="*/*" enabled="false"/>
</staticTypes>
</httpCompression>
<urlCompression doStaticCompression="true" doDynamicCompression="true"/>
</system.webServer>
But is it correct that this code only compress the javascripts and not the CSS, Images and ASP documents?
Apparently I'm just not that bright... It does zip everything after all ;)
I have a web app that contains a slide show with about 10 large images (100-200k) images. I've heard of people using gZip http compression to help improve the performance of their websites in the past so I started doing a little research on this. I ended up finding the following web.config snipit that claims to do this:
<system.webServer>
<httpCompression directory="%SystemDrive%\inetpub\temp\IIS Temporary Compressed Files">
<scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll"/>
<dynamicTypes>
<add mimeType="text/*" enabled="true"/>
<add mimeType="message/*" enabled="true"/>
<add mimeType="application/javascript" enabled="true"/>
<add mimeType="*/*" enabled="false"/>
</dynamicTypes>
<staticTypes>
<add mimeType="text/*" enabled="true"/>
<add mimeType="message/*" enabled="true"/>
<add mimeType="application/javascript" enabled="true"/>
<add mimeType="*/*" enabled="false"/>
</staticTypes>
</httpCompression>
<urlCompression doStaticCompression="true" doDynamicCompression="true"/>
</system.webServer>
But after looking at it a little closer this does not appear to do anything for images.
Is using gZip compression for image mimeTypes effective or would I be wasting my time to add it to the above? Can anyone recommend any good strategies for improving the load time of large images?
Side note: Not sure if it makes a difference but the site is hosted on goDaddy.
JPG images, GIF, etc are already compressed formats. Compressing them further isn't going to help much. You should be looking into caching them instead so that the web server returns 304 responses every time a request for the same image is made.
By the way, the Web.config that you posted is not doing compression on images (as it doesn't help).
UPDATE
Configure IIS to return HTTP 304 Status codes on certain file types.
The JPEG format is a compressed format. So no need to compress it again. Think about compressing scripts and css.
Use SquishIt for compressing javascript and CSS.
Try SmushIt from Yahoo to optimise the images
I am using following web.config block to enable static and Dynamic Compression on IIS7, but its not compressing the response.(Verified it through Fiddler)
<httpCompression directory="%SystemDrive%\inetpub\temp\IIS Temporary Compressed Files">
<scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll" />
<dynamicTypes>
<add mimeType="text/css" enabled="true" />
<add mimeType="message/*" enabled="true" />
<add mimeType="application/x-javascript" enabled="true" />
<add mimeType="*/*" enabled="true" />
</dynamicTypes>
<staticTypes>
<add mimeType="text/css" enabled="true" />
<add mimeType="text/javascript" enabled="true" />
<add mimeType="message/*" enabled="true" />
<add mimeType="application/x-javascript" enabled="true" />
<add mimeType="*/*" enabled="true" />
</staticTypes>
</httpCompression>
<staticContent>
<remove fileExtension=".js" />
<mimeMap fileExtension=".js" mimeType="application/x-javascript" />
</staticContent>
Yet it is not doing any compression. I had also check the server has static/dynamic compression installed.also tried this how-can-i-get-gzip-compression-in-iis7-working but not working for me. Can anyone help with something new?
I had trouble with getting it working by following snippets of advice on StackOverflow. Here's how I managed it.
First, ensure Dynamic Compression is installed as a feature of the Web Role. Normally, you get a warning in IIS Manager if the module is not installed, but you won't if you've set the web.config manually since it tricks the IIS UI logic.
I then removed all the web.config stuff (as in your question) and set it via the IIS Manager. I did this because on MSDN, an easily-missed comment says:
You can also add wildcard entries for the MIME types. However, you can
set MIME types for the web server level only. For example, to enable
static compression for all MIME types for the default website, first
add wildcard entries for the MIME types for the server level, and then
enable static compression for the default website.
Focus on:
However, you can set MIME types for the web server level only.
So I'm not sure whether all those filters and things really work in the web.config. Personally, it didn't for me - i.e. no Content-Encoding: gzip header.
After I took it all out I had to use IIS Manager, under IIS: Compression, to ensure it was set at the server level and then for the site, I had to remove the tick, apply it, tick it again and reapply it.
I ended up with just <urlCompression doDynamicCompression="true" /> in the web.config, which is a bit strange since I don't care for compressing URLs.
Whatever. I do now have Content-Encoding: gzip in the response headers for my site - so I assume its working.
Could you enable Failed Request Tracing, it should include information about what could be happening, it usually falls into a few buckets, 1) Permissions to generate the compressed file, 2) File is too small to require compression, 3) File is not being frequently enough so it is not being compressed, 4) mimetype issue
http://learn.iis.net/page.aspx/266/troubleshooting-failed-requests-using-tracing-in-iis7/
My web hosting provider is running IIS7 and I am having loads of trouble to get gzip compression to work properly. Host admins say compression is installed. I can confirm compression using some online checking services but not with others. PageSpeed Firefox add-on also says the site is uncompressed. I am personally sitting behind a Squid proxy but web.config settings should take care of proxy issue. Below is the relevant web.config snippet. Most of it is borrowed from various sites. Any thoughts?
<urlCompression doDynamicCompression="true" dynamicCompressionBeforeCache="true" doStaticCompression="true" />
<httpCompression cacheControlHeader="max-age=86400" noCompressionForHttp10="False" noCompressionForProxies="False" sendCacheHeaders="True" dynamicCompressionEnableCpuUsage="89" dynamicCompressionDisableCpuUsage="90" minFileSizeForComp="1" noCompressionForRange="False">
<scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll" />
<dynamicTypes>
<add mimeType="text/*" enabled="true" />
<add mimeType="message/*" enabled="true" />
<add mimeType="application/javascript" enabled="true" />
<add mimeType="*/*" enabled="false" />
</dynamicTypes>
<staticTypes>
<add mimeType="text/*" enabled="true" />
<add mimeType="message/*" enabled="true" />
<add mimeType="application/javascript" enabled="true" />
<add mimeType="*/*" enabled="false" />
</staticTypes>
</httpCompression>
This post is about 4 months old, but have you checked if dynamic compression is enabled in IIS? There's an article here on how to do it
http://blog.wassupy.com/2009/08/enabling-dynamic-http-compression-in.html
By default IIS it isn't enabled. Might be worth trying.
Try two this towards resolving this issue:
Try following the case standard for setting booleans in the web.config and use lower case rather than pascal casing.
Try connecting to the site on the server via IIS if your host allows this and check the compression section to see if it is locked.