http-compression

gzip compression in web server or app server?

删除回忆录丶 提交于 2019-12-23 04:37:40
问题 I'm using Weblogic application server and Apache web server in my J2EE environment and planning to implement gzip compression of response. Not sure, whether to implement compression on the Apache server or on the weblogic. 回答1: Unless you have a very good reason to not do so, you want to put the load of compression on the web servers since the app servers are already busy at doing other things. To use mod_weblogic together with mod_deflate , have a look at this post. 回答2: Depends whether you

“Content-encoding” header disappears from HttpHandler response if an exception occurs

一曲冷凌霜 提交于 2019-12-22 05:27:06
问题 I have a custom HttpHandler in which I manually enable output compression, like so: context.Response.AppendHeader("Content-encoding", "gzip"); context.Response.Filter = new GZipStream(context.Response.Filter, CompressionMode.Compress); This works nicely for most requests, but when an exception is encountered the "Content-encoding" header disappears from the response, while the compression filter remains in place. The result is that the error page is gzip compressed, but the browser receives

Why Chrome prompts for downloading a page as a .gz file on hyperlinks but not I enter the URL manually?

筅森魡賤 提交于 2019-12-21 12:37:06
问题 I just discovered a very strange behaviour on Chrome while trying to accesss some pages. It will prompt to download them as .gz files instead of loading them. This happens only with current Chrome and on all platforms. When the page is properly loaded I can see this on the Inspector Resource interpreted as Document but transferred with MIME type application/x-gzip: "https://confluence.example.com/display/engp/PR-1221". I know that these are served by an nginx server which is configured to use

Azure CDN - Enabling HTTP 304 Caching with ETag - Hosted Web Role

雨燕双飞 提交于 2019-12-21 04:29:11
问题 We are trying to enable HTTP compression (gzip) and HTTP 304 Caching via ETags on Azure CDN. We already discovered an issue with enabling Azure CDN Compression, but now we can't get compression and ETag caching (304s) working simultaneously. This issue has been posted to Azure forums here. Here is an example of the compressed, but not HTTP cacheable (304) link: https://xxxx.vo.msecnd.net/resourceManager.axd?token=HL80vX5hf3lIAAA&group=core.js Here is an example of the cacheable (304), but not

How do I compress a Json result from ASP.NET MVC with IIS 7.5

拥有回忆 提交于 2019-12-20 08:02:00
问题 I'm having difficulty making IIS 7 correctly compress a Json result from ASP.NET MVC. I've enabled static and dynamic compression in IIS. I can verify with Fiddler that normal text/html and similar records are compressed. Viewing the request, the accept-encoding gzip header is present. The response has the mimetype "application/json", but is not compressed. I've identified that the issue appears to relate to the MimeType. When I include mimeType="*/*" , I can see that the response is

Tomcat8 Gzip Compression for CSS, JS

流过昼夜 提交于 2019-12-19 03:15:50
问题 I am using tomcat8 and trying to simulate GZIP compression of CSS and JS. I have added the entry in server.xml and follows <Connector port="8088" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" compression="on" compressionMinSize="2048" noCompressionUserAgents="gozilla, traviata" compressableMimeType="text/html,text/xml,text/plain,text/css,text/javascript,text/json,application/x-javascript,application/javascript,application/json" /> And in my html page i have included the

IIS 7.5 Static Content Compression (not consistent )

☆樱花仙子☆ 提交于 2019-12-19 00:09:32
问题 I have the following web.config: <urlCompression doStaticCompression="true" /> <httpCompression> <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=

mod_deflate or mod_gzip, which should be used?

荒凉一梦 提交于 2019-12-18 16:49:41
问题 mod_deflate or mod_gzip , which should be used? I read mod_gzip on better explained but want to know extra about mod_deflate . 回答1: You should read "Compressing Web Content with mod_gzip and mod_deflate" by Stephen Pierzchala. From a pragmatic point of view, I suggest mod_deflate because it is easy to configure, well documented, and actively maintained. Also, a precompiled version of mod_deflate is more than likely available for your server. Apache may even come with mod_deflate , as is the

How to zip- compress HTTP request with Spring RestTemplate?

柔情痞子 提交于 2019-12-18 14:54:47
问题 How to gzip HTTP request , created by org.springframework.web.client.RestTemplate? I am using Spring 4.2.6 with Spring Boot 1.3.5 (Java SE, not Android or Javascript in the web browser). I am making some really big POST requests, and I want request body to be compressed. 回答1: I propose two solutions, one simpler without streaming and one that supports streaming. If you don't require streaming , use a custom ClientHttpRequestInterceptor, a Spring feature. RestTemplate rt = new RestTemplate();

What is gZip compression?

早过忘川 提交于 2019-12-18 11:05:37
问题 I have heard a lot that one should use gZip for their webpages for faster access and downloads, and that it also saves the bandwidth. So what is this gZip compression and how does it make the downloads faster ? Does it compress the HTML and images or just the HTML. If I am to start using gZip in my webapps what considerations do I need to make ? Are there any server or browser restrictions for it, or does it support a particular encoding only. 回答1: GZip is a form of data compression -- ie it