Questions tagged [gzip]

1

votes
3

answer
1.3k

Views

Pickle+gzip - how to utilise multiple cores?

I am using simple function to restore state before starting work: import pickle, gzip def load(filename): '''Loads a compressed object from disk ''' file = gzip.GzipFile(filename, 'rb') return pickle.load(file) records_df = load('records_all_in_one.gzp') The problem is that restoring state i...
petr
1

votes
0

answer
57

Views

serve compressed file with no file extension with .htaccess

I have a website chat plugin script that I've made a local copy of, and uploaded to our website: www.example.com/js/default. webpagetest.org reports this file is uncompressed. In .htaccess, we have: AddType x-font/woff .woff AddType x-font/ttf .ttf AddOutputFilterByType DEFLATE image/svg+xml AddOutp...
Steve
1

votes
0

answer
28

Views

Python3 download remote gzip file to csv reader in memory

I'm trying to migrate a project to python3. I'm downloading a gzip file, reading in memory and parsing as a csv reader object. When it comes to looping through the reader, i'm only getting the first character instead of the whole row. Where am i going wrong? response = requests.get(feed_url, stream=...
lennard
1

votes
0

answer
56

Views

File format/extension not preserved inside gzip file when compressed using java

I tried compressing a file to gzip format. File format/extension of the source file is not preserved inside the compressed .gz file. I used the following java code to gzip the file. I am able to get file format inside the .gz file if toFile = test.csv.gz but the file format is not available if toFil...
Sibi
1

votes
1

answer
106

Views

How can I gzip a jade template in Node JS

I would like to gzip my index.pug because apparently it is required so that I can use certain VectorTiles on leaflet. Here is my server.js ` var loopback = require('loopback'); var boot = require('loopback-boot'); var compression = require('compression'); var bodyParser = require('body-parser'); v...
BStill
1

votes
0

answer
206

Views

How to split gzip files and move to hadoop hdfs?

I have 200 of 1GB gzipped files - A.1.gz - A.2.gz ... - A.200.gz Because I am using a hadoop cluter that doesn't support 'lzo' format, I am considering the following 2 options: Decompress each file and split it by 64Mb plain text files and copy them to hdfs gzip the plain text files above and put th...
notilas
1

votes
2

answer
303

Views

Is DEFLATE used in gzip and png compression the same?

I read about gzip compression and png image compression and they both use DEFLATE alghorithm, but I'm not sure that the implementation of that algorithm is the same. Also, if it's the same algorithm, then what is the difference between those compressions, besides the fact that png compression uses d...
Maja K
1

votes
0

answer
24

Views

strange behavior of the iis7 gzip-compress

Good day. I'm trying to configure gzip-compression for the site. Put ticks in the settings of the iis-7 itself. Also I wrote the following in the web.config file: As a result: For js and css files, compression works, but for some reason it starts working with 3-4 reload page in the browser after the...
Sergey Glazirin
1

votes
1

answer
58

Views

Is it possible to reference systems.io.compression?

I am trying to uncompress a webresponse that I receiving gzip compressed. I tried setting Accept-Encoding headers to hopefully not receive the compressed JSON string, but it didnt work and I am convinced that the server forces gzip compression on the response. I am using this as part of an EXCEL spr...
Epiquin
1

votes
0

answer
131

Views

Akka stream throws ParsingException when start decompressing .gz file from middle offset

I am reading .gz file from AWS S3 bucket using Akka streaming, The application reads chunk of data and process it. The following code is working fine when I read file from beginning but if I start file from particular offset then Decompression fails and throws ParsingException. Code: object StreamA...
Nikhil
1

votes
0

answer
67

Views

Get browser to unzip a gzipped http response

Is there a way I can force a browser to unzip an http response? I'm just trying to fetch prezipped files (.e.g foo.json.gz) from a simple server. I want this: fetch('foo.json.gz').then(x => x.json()).then(unzipped_data => ...) All my hosted files are prezipped, and I just want to use a basic static...
Shaun Lebron
1

votes
1

answer
199

Views

Java GZip makes small differences when compressing file and decompressing it again

After a week of work I designed a binary file format, and made a Java reader for it. It's just an experiment, which works fine, unless I'm using the GZip compression function. I called my binary type MBDF (Minimal Binary Database Format), and it can store 8 different types: Integer (There is nothing...
RgSW
1

votes
1

answer
216

Views

I deployed my node app on Heroku and want to enable Gzip compression, any tips?

I tried to wire up a code from: https://github.com/wimagguc/nodejs-static-http-with-gzip/blob/master/http-with-gzip.js Directories and Server.js File I made changes by adding the code: path.exists(filePath, function(exists) { if (exists) { fs.readFile(filePath, function(error, content) { if (error)...
manik singh
1

votes
0

answer
120

Views

SVG compression with Angular 5 app hosted on Azure App Service

I'm having some trouble getting SVG's to gzip in our Angular 5 application hosted as an Azure Web App. I tried to follow this article, although it does say that Azure plans to have SVG's gzip automatically in the future, and this was written quite some time ago: https://coryrylan.com/blog/svg-gzip-...
adam3039
1

votes
0

answer
539

Views

gzip json compression Tomcat 8

I'm trying to use gzip compression on Tomcat 8 JSON requests, I've added the following attributes to the connector in the server.xml useSendfile='false' compressableMimeType='text/html,text/xml,text/plain,text/css,text/javascript,application/javascript,application/json,application/pdf,application/xh...
OakvilleWork
1

votes
1

answer
536

Views

How to verify if .gz files are loading in chrome browser for VueJs application?

I have simple VueJs application with webpack and in webpack.prod.conf.js file, I have enabled productionGzip which generates .gz file for each of the chunks in dist folder. productionGzip: true, productionGzipExtensions: ['js', 'css'], When I am loading my application in browser, I can see .js files...
skubal
1

votes
1

answer
111

Views

How to know if a file is being compressed

From a set of files, I'm creating a tar file and, from the tar file, a tar.gz file (using python). The creation of the compressed file could take time, so: I'd like to know if there is a way to know that the 'process to create a compressed file' is 'on-going'. Maybe checking by some temp file or sim...
Lobo
1

votes
1

answer
154

Views

Sending and receiving tarfile via MQTT - python

I'm able to send a tarball via MQTT using a python script, but when I receive it, I go to unzip it and receive an error. After tracking down the error, it appears as if the input stream is not tar-ing up the file, so even though the extension is .tar.gz, it is not an actual .tar.gz file. It sounds r...
SomeGuy
1

votes
1

answer
52

Views

Does Gzip/Deflate recognize patterns

I am studying the inner-workings of Gzip, and I understand that it uses a combination of Huffman Coding and LZ77. I also realize that a Gzip file is divided into blocks, and each block has a dictionary built for it. Then frequent occurrences of similar data are replaced by pointers pointing at loca...
YAHsaves
1

votes
0

answer
333

Views

How to force the use of gzip behind the reverse proxy?

I want to use nginx as a reverse proxy and I really want to optimize the communication between nginx and our backend. The payloads we are transferring are about 1Mb of text when not compressed and the reverse proxy and the server are in different data centers. My understanding and the tests I have d...
poussma
1

votes
0

answer
332

Views

Angular 6 - ServiceWorker not requesting gzipped content

I recently added service worker to my Angular 6.0.3 app. Everything works great. I observed a slight increased initial load time when app is loaded the first time and to my surprise, the mainxxxx.js file being downloaded was 3.1 MB. Cloudfront gzips the js files reducing the size of main.xxx.js to a...
adnan kamili
1

votes
0

answer
138

Views

Sending .gz file via CURL to RESTful put creating ZipException in GZIPInputStream

The application I am creating takes a gzipped file sent to a RESTful PUT, unzips the file and then does further processing like so: public class Service { @PUT @Path('/{filename}') Response doPut(@Context HttpServletRequest request, @PathParam('filename') String filename, InputStream inputStream) {...
user3389672
1

votes
1

answer
144

Views

OutputCache is not working if content encoding addded to header

I have a controller and an action in it. public class LoginController { [OutputCache(Duration = 10000, VaryByParam = 'none')] public ActionResult Logout() { ...... } } Above code is working and there is no problem with output cache. Everything is ok. But when i added the code below to Application_Be...
brtb
1

votes
0

answer
154

Views

SVG contentDocument null for Content-Encoding: gzip

I have an SVG inside an object tag. I notice that if I store the SVG uncompressed, and serve it with 'Transfer-Encoding: gzip', the image renders properly and I am able to access its contentDocument. If I store the SVG compressed (as svg.gz) and use 'Content-Encoding: gzip', the image renders proper...
Diego
1

votes
1

answer
171

Views

Decoding gzip response body from Packetbeat

I am using Packetbeat to monitor the requests/responses into/out of Elasticsearch client nodes using the http protocol watcher on port 9200. I am sending the output of Packetbeat through Logstash, and then from there out to a different instance of Elasticsearch. We have compression support enabled i...
Lusid
1

votes
0

answer
223

Views

Angular 5 Content Upload GZip

I am using Angular 5 on the client-side. I have some large text content that I need to upload to my server using my API. I am trying to pass the Content-Encoding: gzip header and send compressed contents to the server from Angular 5. I tried researching few gzip libraries like pako, zlib, etc and no...
Narayanan
1

votes
2

answer
35

Views

Python: Cannot gunzip file made with gzip

I'm exploring file compression options, and am confused by the behavior of the gzip module in Python. I can write a gzipped file like this: with gzip.open('test.txt.gz', 'wb') as out: for i in range(100): out.write(bytes(i)) But if I then run gunzip test.txt.gz the output (test.txt) is still binary....
duhaime
1

votes
0

answer
171

Views

Scanning GZIP compressed Qr Code using Firebase ML Kit

I am trying to scan a Qr code's Binary value which is GZIP compressed,but I am getting unknown encoding from most of the scanner. QR VALUE: ABCDEFGHI, UTF-8 encoding,GZIP Compressed. I tried doing the same with zxing,zbar and now ML Kit. Response after detection is 'UNKNOWN ENCODING TYPE'.I heard w...
Ajg Theta
1

votes
0

answer
29

Views

Gzip compression not applying to javascript files

I have several javascript files that are not being compressed, as far as I can tell via scans like Pagespeed insights and GtMetrix. I have the following code in my .htaccess file to enable compression. mod_gzip_on Yes mod_gzip_dechunk Yes mod_gzip_item_include file .(html?|txt|css|js|php|pl)$ mod_gz...
HeatherWebDev
1

votes
0

answer
43

Views

base64 gzip decompression in R

I get from an API a base64 gzip compressed string and want to decompress it in R. input: a compressed base64 gzip string output: decompressed string tried out: string
Herbert Zaczyk
1

votes
0

answer
361

Views

How to setup fetch for React Native Android using gzip?

My React Native app had been working fine on both iOS and Android but recently it gives Network request failed error on Android when the response is long. I found out if I set the request's header to 'Accept-Encoding': 'gzip',, I was able to log response, but it only contains header and such: { ty...
bleepmeh
1

votes
0

answer
238

Views

zlib fails to decompress gzip data

I'm using the zlib node module to compress data, encrypt it with the crypto module and then safe it to a file. Reading and writing the file works fine, as well as encrypting and decrypting the data, but how ever when I try to decompress the data with zlib.unzip it returns the following error. Error:...
anonymoose
1

votes
1

answer
67

Views

How to handle client downloading gzip served from Node.js server app?

I have a question about handling a gzip response on my client side application. I would like the client's browser to pop up an alert 'how do you want to handle?' download prompt. My Node.js server is compressing my files into a gzip format then sending it with a HTTP write response. My client recei...
colin rosati
1

votes
0

answer
78

Views

Elasticsearch bulk request with gzipped data in nodejs

We have a lot of records to be indexed in Elasticsearch. For POC, we are running a local Elasticsearch cluster, e.g. localhost:9200. We have turned on the cluster compression support in config/elasticsearch.yml but adding http.compression: true When the record size increases, Elasticsearch throws er...
Ashwin Aggarwal
1

votes
2

answer
380

Views

How to extract zip file and keep original in linux?

I want to unzip a zip archive on server and keep original zip file with is as well. When I use unzip myFile.zip command it only adds extracted myFile but removes the original myFile.zip file. So what command should I use to keep original file with extracted file?
Ayush
1

votes
0

answer
50

Views

Zlib fails to decompress utf8 encoded string

I am playing with zlib in NodeJs with the following code. const input = 'This is test' const encoding = 'base64' zlib.gzip(input, (err, buffer) => { if (!err) { const stringified = buffer.toString(encoding) console.log(stringified) const bufferToDeCompress = Buffer.from(stringified, encoding) zlib.u...
ygnr
1

votes
0

answer
154

Views

Springboot gzip compressing responses having size less than min-response-size configured

I am trying to implement Gzip response compression in my Springboot Rest API I am using below configuration in my application.properties # Enable response compression server.compression.enabled=true # The comma-separated list of mime types that should be compressed server.compression.mime-types=text...
Shubham Goyal
1

votes
2

answer
76

Views

Akka Http Test Gzip Response

So, I have a set of Akka Http routes written in scala. Which looks like this val route: Route = { handleRejections(PrimaryRejectionHandler.handler) { handleExceptions(PrimaryExceptionHandler.handler) { cors() { encodeResponseWith(Gzip) { pathPrefix('v1') { new v1Routes().handler } ~ path('ping') { c...
Debdutto Chakraborty
1

votes
2

answer
104

Views

gzip/deflate compression with Server Sent Events on tomcat servlet

I am using server sent events for streaming responses (text/event-stream). We want to compress the response using gzip or deflate compression, but the browser shows : ERR_CONTENT_DECODING_FAILED. Code for the same - response.setContentType('text/event-stream; charset=UTF-8'); response.addHeader('Co...
Shiva Bhalla
1

votes
0

answer
26

Views

ServletOutputStream writes extra bytes to response

Here's my JavaEE application filter#doFilter code public void doFilter(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws IOException, ServletException { GZIPServletResponseWrapper gzipResponse = new GZIPServletResponseWrapper(response); filterChain.doFilter(re...
Valentine Anzhurov

View additional questions