compression

Gzip not working, server 2012, IIS 8

半腔热情 提交于 2019-12-01 11:16:45
问题 Problems with activating Gzip on IIS 8 on a windows server 2012 (standard) So i activated the compressions in the windows features I checked both checkboxes in IIS - compression (dynamic and static) But still no Gzip available. However, on my localhost machine (just a windows 10) this works. What i do see, is that the gzip temp directory (C:\inetpub\temp\IIS Temporary Compressed Files) is getting filled up when i browse my site via the server localhost. BUT strangely enough i'm not seeing

Deflate Compression Stream where pre compressed Data can be inserted. Does a .NET lib exist?

試著忘記壹切 提交于 2019-12-01 11:13:33
I'm implementing Deflate and GZip compression for web content. The .NET Framework DeflateStream performs very well (it doesn't compress that good as SharpZipLib, but it is much faster). Unfortunately it (and all other libs i know) miss a function to write precompressed data like stream.WritePrecompressed(byte[] buffer). With this function it would be possible to insert precompressed blocks in the stream. This could reduce the cpu load for compressing this part and increase the total throughput of the web server. Is there any managed lib capable of doing this? Or is there any good starting

How to solve Gzip Magic Number Missing

荒凉一梦 提交于 2019-12-01 11:01:37
问题 I have a string that I Gzip on the server and download to a client using the WebClient class. When I try to uncompress it, I get the error message that the Magic Number is missing. I have tried both the GZipStream class and the ICSharpLib methods of solving this, so I'm at a loss. The compression/decompression works if I omit the step of downloading via the WebClient (using DownloadData which returns the data as byte[]), so I can only assume that there is some problem with the data getting

Logging raw and compressed HTTP responses in ASP.NET & IIS7

非 Y 不嫁゛ 提交于 2019-12-01 09:27:51
Along the lines of this question I want to create a HttpModule that will do some custom logging of requests and responses for us. Using the code in the most popular answer for that question I've got a HttpModule up and running which does indeed work: class PortalTrafficModule : IHttpModule { public void Dispose() { // Do Nothing } public void Init(HttpApplication context) { context.BeginRequest += new EventHandler(context_BeginRequest); context.EndRequest += new EventHandler(context_EndRequest); } private void context_BeginRequest(object sender, EventArgs e) { HttpContext context = (

download and decompress a zip file in windows phone 8 application

偶尔善良 提交于 2019-12-01 09:15:23
问题 I am working on a windows phone 8 application (phonegap) which downloads a zip file from my server location, I want to unzip this file in my application at runtime to use the files in the archive. 回答1: You can use 3rd party libraries in order to decompress and extract ZIP files in WP7/WP8. The most common one is #ZipLib which you can download the WP7 port from @ http://slsharpziplib.codeplex.com/ My personal favourite library is DotNetZip which is a superset of #ZipLib and much more stable

need help on how to encode words using huffman code

天涯浪子 提交于 2019-12-01 09:10:52
how do you encode words using the huffman code such as NEED Huffman encoding basically uses variable-length bit strings to represent tokens (generally characters with a couple of exceptions). The more common a token is, the shorter it's bit-length is and this is (usually) dynamic as the stream is processed. There are usually two special tokens, ESCAPE and END-STREAM. Encoding maintains a dictionary which is basically a lookup of the bit sequences to get a token. Initially it contains only the two special tokens. The initial bit sequences for ESCAPE and END_STREAM could be 0 and 1 (which is

How to find uncompressed size of ionic zip file

試著忘記壹切 提交于 2019-12-01 08:36:26
I have a zip file compressed using Ionic zip . Before extracting I need to verify the available disk space. But how do I find the uncompressed size before hand? Is there any header information in the zip file (by ionic) so that I can read it? Taniq This should do the trick: static long totaluncompressedsize; static string info; . . . . // Option 1 foreach (ZipEntry e in zip) { long uncompressedsize = e.UncompressedSize; totaluncompressedsize += uncompressedsize; } // Or // Option 2 - will need to sift through the mass of info using (ZipFile zip = ZipFile.Read(zipFile)) { info = zip.Info; }

How to compress HTTP response headers?

99封情书 提交于 2019-12-01 08:20:49
At the Velocity 2010 conference, Google said that header compression can yield big gains : Hölzle noted a glaring inefficiency in the handling of web page headers, which provide information about a user’s IP address, browser and other session data. The average web page makes 44 calls to different resources, with many of those requests including repetitive header data. Holzle said compressing the headers produces an 88 percent page load improvement for some leading sites. How does one ensure that the response headers sent by the web server are compressed? Is this even possible with today's

Android, Compressing an image

淺唱寂寞╮ 提交于 2019-12-01 08:16:02
I am sending an image over the network via wifi or the mobile network to be stored in a server and retrieved again. I've done that but due to the size of images taken by the camera it's making my app slow, just to point out I'm opening the gallery and taking the pictures from there and not taking the picture directly from the app. I have noticed that images from whatsapp that have been taken from the camera and gallery have been compressed to approx. 100kb. At the moment my code takes a file and converts it to bytes and then sends it. Here is the method for taking a file and converting it to

Adding a big text file to assets folder

本小妞迷上赌 提交于 2019-12-01 08:10:09
I'm developing an Android 2.2 application. I want to add some big text files (4.5MB or more) to Android project. First I don't know if I can add such kind of big files to assets folder. But, if I can, is it possible to compress them? How can I compress files? and decompress? Any other better way to add big text files to Android project? Thanks. rosstheboss Files over 1 MB placed in the assets folder won't be readable from your app (It'll throw an exception). This is because they get compressed during the build process, and thus the phone requires substantial resources to uncompress them when