gzip

memcache gzipped content with php ob_gzhandler

I recently implemented gzipping of my content with php's ob_gzhandler function which keeps things really simple. I'm now trying to add this content to my memcache, and was hoping there was a simple way to do that as well, but I haven't been able to find anything online about accomplishing this. I've only used memcache in the past to ...

How to request for gzipped pages from web servers through ruby scripts?

I have a ruby script that goes and saves web pages from various sites, how do i make sure that it checks if the server can send gzipped files and saves them if available... any help would be great! ...

What is the best way to decompress a gzip'ed server response in Python 3?

I had expected this to work: >>> import urllib.request as r >>> import zlib >>> r.urlopen( r.Request("http://google.com/search?q=foo", headers={"User-Agent": "Mozilla/5.0 (X11; U; Linux i686) Gecko/20071127 Firefox/2.0.0.11", "Accept-Encoding": "gzip"}) ).read() b'af0\r\n\x1f\x8b\x08...(long binary string)' >>> zlib.decompress(_) Traceb...

Strange http gzip issue

Here's a strange one: I've got nginx reverse proxying requests to apache 2 with mod_php. A user (using firefox 3.1b3) reported that recently, he's started getting sporadic "What should firefox do with this file?" popups during normal navigation. We haven't had any other reports of this issue, and haven't been able to reproduce it ours...

how to use pycurl if requested data is sometimes gzipped, sometimes not?

I'm doing this to fetch some data: c = pycurl.Curl() c.setopt(pycurl.ENCODING, 'gzip') c.setopt(pycurl.URL, url) c.setopt(pycurl.TIMEOUT, 10) c.setopt(pycurl.FOLLOWLOCATION, True) xml = StringIO() c.setopt(pycurl.WRITEFUNCTION, xml.write ) c.perform() c.close() My urls are typically of this sort: http://host/path/to/resource-f...

Will HTTP Compression (GZip or deflate) on a low traffic site actually be beneficial?

I have a web application where the client will be running off a local server (i.e. - requests will not be going out over the net). The site will be quite low traffic and so I am trying to figure out if the actual de-compression is expensive in this type of a system. Performance is an issue so I will have caching set up, but I was consi...

How can I get gzip compression in IIS7 working?

I have installed Static and dynamic compression for IIS7, as well as setting the two web.config values at my application ( Virtual Folder ) level. As I understand it, I don't need to enable compression at the server, or site level anymore, and I can manage it on a per folder basis using my web.config file. I have two settinsg in my .co...

Compress multiple files individually with Gzip

Dear all, I have several directories that look like this: dir1/ |_foo.txt |_bar.txt dir2/ |_qux.txt |_bar.txt For each of this directory I want to compress the files inside it into *.gz format then delete the uncompressed ones. So finally we hope to get something like this: dir1/ |_foo.gz |_bar.gz dir2/ |_qux.gz ...

Issues with .net gzip decompression stream

What could be wrong with those set of methods? byte[] bytes; using (var memory_stream = new MemoryStream()) using (var gzip_stream = new GZipStream(memory_stream, CompressionMode.Compress)) { var buffer = Encoding.Default.GetBytes("Hello nurse!"); gzip_stream.Write(buffer, 0, buff...

Gzip versus minify

I had a somewhat lively discussion the other day about minifying Javascript and CSS versus someone who prefers using Gzip. I'll call this person X. X said that Gzip allready minifies the code, since it zips your files. I disagree. Zip is a lossless method of shrinking filesize. Lossless means the original must be restored perfectly, m...

How to cache Apaches GZIP compressed content

Apache has built in capabilities to GZIP content (HTML, JPG.. etc) Every time its done it uses slightly more CPU then it would normally. So my question, Is it possible to cache the end compressed version instead of having your machine doing it every single time. ...

How to determine the Content-Length of a gzipped file?

Right now I'm trying to serve CSS and JS files from a server that won't let me enable mod_gzip or mod_deflate. So I wrote a small PHP script to compress with GZIP and return to the user. Example Code: $filename = "style.css"; if (!file_exists($filename) || !($info = stat($filename))) { header("HTTP/1.1 404 Not Found"); die(); } ...

gzipping server responses worse off

Hi guys, Following yahoos performance teams advice, I decided to enable mod_deflate on Apache. In checking the results (using HTTPWatch), the gzipped responses took on average a 100 milliseconds more than the non-gzipped? The server is on average load using <5% of CPU. Compression level is at minimum? have you guys experienced resul...

HttpWebRequest & Native GZip Compression

When requesting a page with Gzip compression I am getting a lot of the following errors: System.IO.InvalidDataException: The CRC in GZip footer does not match the CRC calculated from the decompressed data I am using native GZipStream to decompress and am looking at addressing this. With that in mind is there a work around for...

.Net client vs Java Server with raw data

I am writting a .Net/C# client to a Java Server on Solaris. The Java server is writting Raw byte data in a Gziped format which I need to extract, but I am having trouble to read the data in the right buffer sizes. I read the message not-deterministicly incomplete or complete and can not read the second message in any case. I am reading ...

Does ob_gzhandler correctly determine buggy Internet Explorer versions?

I can't seem to find an answer to this anywhere. It's well known that certain versions of IE6 and earlier incorrectly declare they accept gzip encoding. Does ob_gzhandler correctly detect these versions or do you need to do that separately? ...

1 or more bytes truncation with GZip round trip [solved]

Hi I dont get it. I have used a similar/same approach for many years now, and never experienced this. For some reason, that I did not pick up until today, a GZip round trip results in 1 or more bytes being truncated or data being garbled. I wrote a simple test to verify that something else is not affecting it. This always fails with ...

unzip (zip, tar, tag.gz) files with ruby

I want do unzip a lot of zip files, is there a module or script that check which format the zip file is and decompress it? this should work on linux, other OSs I don't care for this. ...

File extention of zlib zipped html page?

What does a zipped html file using zlib (deflate) look like sitting on the server? Does it have a different extension than .html? ...

How can I compress a char array into a compressed html page using Zlib

I have a CGI application in C that creates an html page by saving a char* as a html page: void saveTextFile(const char *filename, const char *str){.......} called as saveTextFile("..\\index.html",outputFile); How do I use zlib to take as input the "outputFile" char array and output a zipped html page with appropriate headers? Wo...