0

I need the pages in my site to load faster. So I heard about an html compressor that can reduce the html size that I send to the client. Does anybody know about a way to do that. I preffer an already made dll if possible...

mashta gidi
  • 791
  • 1
  • 8
  • 27

4 Answers4

1

Using compression does not always work.

When IIS compresses a page it keeps it in the memory till the page is expired or contents are changed. If server side has more dynamic pages having large amount of data then it can actually degrade the performance.

You should try to optimize the server side code and also reduce the client side code.

  1. Many people make the mistake of writing JavaScript with variable name which are long. This increases the size of the page.
  2. Unnecessary comments on the html are also not good.
  3. Using .js files for commmon functions.
  4. If you have data which does not change frequently, depending upon the type of data and size of the data you could try caching the same data in server side Cache. This reduces the query in the database.

Compression is good for static pages.

Malachi
  • 3,182
  • 4
  • 27
  • 45
0

Take a look at the html that your site produces. Do so by surfing to the pages in internet explorer (or other browser), right click the page body in your browser and select view source. If you are using ASP.NET the hidden field _VIEWSTATE may be big. If so try to disable it in your various page controls where its not needed. Look also in the source for other unneeded output.

mortb
  • 7,874
  • 3
  • 21
  • 38
0

Heavy CSS files affect the load-time of web pages, you can use this online utility to compress your CSS and it will make your webpages load faster.

http://www.cssdrive.com/index.php/main/csscompressor

Same applies to JS files, and here is JS Compressor tool

http://jscompress.com/

Note: I am not a promoter/supporter of above sites.

Tahir Yasin
  • 10,631
  • 5
  • 38
  • 58
0

IIS has this compression built in and it's on for static files by default.

To enable dynamic compression at the server level use the folowwing command:

C:\Windows\System32\Inetsrv\Appcmd.exe set config -section:urlCompression -doStaticCompression:true -doDynamicCompression:true 

Alternatively if you would like to only enable dynamic compression for one site:

C:\Windows\System32\Inetsrv\Appcmd.exe set config "Site Name" -section:urlCompression -doStaticCompression:true -doDynamicCompression:true

If you would like to learn more about configuring compression in IIS for dynamic files see the below links:

http://technet.microsoft.com/en-us/library/cc771003%28v=ws.10%29.aspx

http://weblogs.asp.net/owscott/archive/2009/02/22/iis-7-compression-good-bad-how-much.aspx

Andrew Walters
  • 4,592
  • 6
  • 31
  • 47
  • Answers on SO should not just be links to other pages. Your answer should answer the question on it's own; links should just be supplemental. You should quote, paraphrase, or summarize the content of the links, take the time to put them into context, or simply provide your own answer and provide the links "for further reading" or "reference". [More Info](http://meta.stackexchange.com/questions/94022/how-can-i-link-to-an-external-resource-in-a-community-friendly-way) – Servy Sep 13 '12 at 15:00